Comments (7)
Hi @LuisYordano, thank you for this precise bug report. I can indeed reproduce this.
In general, when using ROS2 you should not revert or reload the simulation as this will stop the ROS2 node communicating with Webots.
But there is indeed a bug, when the simulation is reverted the ROS2 node does not end correctly (which is why you did get the Goal Accepted
), I am attempting to fix this in #39 (without success for now).
from webots_ros2.
Hi @DavidMansolino,
I don't know if this helps, but in Gazebo there is the commands:
- rosservice call /gazebo/reset_simulation "{}"
- rosservice call /gazebo/reset_world "{}"
- rosservice call /gazebo/pause_physics "{}"
- rosservice call /gazebo/unpause_physics "{}"
Webots is different from Gazebo, but the concepts of Reset Simulation, World, Pause, UnPause, would be implemented with the same philosophy in Webots as services in ROS2.
from webots_ros2.
Thank you for the information.
We have indeed not yet implemented these functionalities, but we will shortly so that you can easily reset the world.
Just one small question, when you reset the world, the nodes remain connected to Gazebo, right?
from webots_ros2.
Affirmative!!!
Nodes only terminate communication with ROS Master (ROS1) and ROS2 when the user press CTRL+C.
from webots_ros2.
Ok, thank you for the confirmation, I have added a new issue specific to these missing services: #40 (do not hesitate to comment if you think some other important services are missing).
from webots_ros2.
What about respawning the driver?
def generate_launch_description():
webots_driver = Node(
package='webots_ros2_driver',
executable='driver',
parameters=[
{'robot_description': robot_description }
],
# Every time one resets the simulation the controller is automatically respawned
respawn=True
)
webots = WebotsLauncher(world=PathJoinSubstitution([package_dir, 'worlds', world]))
return LaunchDescription([webots, webots_driver])
If you have some other nodes that have to be restarted (e.g. ros2_control
) then you can use the OnProcessExit
event handler:
def get_ros2_control_spawners(*args):
return [
Node(
package='controller_manager',
executable='spawner.py',
arguments=['diffdrive_controller']
)
]
def generate_launch_description():
webots_driver = Node(
package='webots_ros2_driver',
executable='driver',
parameters=[
{'robot_description': robot_description }
],
# Every time one resets the simulation the controller is automatically respawned
respawn=True
)
webots = WebotsLauncher(world=PathJoinSubstitution([package_dir, 'worlds', world]))
return LaunchDescription([
webots,
webots_driver,
launch.actions.RegisterEventHandler(
event_handler=launch.event_handlers.OnProcessExit(
target_action=tiago_driver,
on_exit=get_ros2_control_spawners,
)
)
] + get_ros2_control_spawners())
from webots_ros2.
I will close the issue. Feel free to re-open it if the answer doesn't solve your problem
from webots_ros2.
Related Issues (20)
- Inquiry about Native Windows Support for `webots_ros2`
- Cannot build webots_ros2_driver
- don't know how to launch multiple robots in the simulator
- ros couldn't connect with webots
- How to add Radar sensor to TeslaModel3? HOT 3
- extern controller can not find the robot
- I can't use ros2_driver
- Build Issues on ROS 2 Buildfarm for Rolling
- `webots_ros2_driver` cannot connect when using Docker and macOS
- ROS2 Humble with Ubuntu 22.04 can't communicate with the demos robots HOT 18
- Explanation about the parameter: 'robot_description' HOT 3
- wrong documentation HOT 2
- Ros2: Connect to webots remotely
- External Libraries in CMakeLists.txt
- Unable to use all examples HOT 17
- Issue about Webots Camera HOT 1
- API and robot description handling changes in CM and RM HOT 1
- The robot is already connected or your IP address is not allowed by this instance of Webots.
- how to change the topic publish frequency of imu or other sensor? HOT 1
- tesla imu support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webots_ros2.