-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gazebo ignition simulation crashes when trying to simulate multiple turtlebot4 #60
Comments
One thing you can do to make two robots work better is pass the namespace in without a slash prepended. For example:
Does this make the system functional for your use case? When I do this I am able to have the topics show up seemingly properly (I haven't gone through all of the topics or done that much in terms of testing. That being said, it does still seem to be trying to respawn elements from the world, I am not sure why that is. I will add this to my list of things to look into but anyone else feel free to look into this and contribute as well. I am unable to spawn 3 robots although it is hard to say right now if this is a limitation because of the issue aforementioned or if it is just about the pure number of nodes / topics. You could try disabling sensors that you aren't using and see if that allows you to spawn 3 robots. |
The problem is that I needed at least 4 robots to perform navigation and mapping of an area for a school project and the turtlebot4 simulator doesn't support that feature yet without producing errors in the console. |
The same error occurs for me, having the Debian package installed. |
The simulation also crashes when adding two robots and one object with inertia. It does not crash when adding one robot and two objects (boxes) with inertia. |
@abdosalem490 I cannot speak to the capabilities of Turtlebot3 as I have not used it before. You could inquire on the Turtlebot3 repo or robotics stack exchange. @msminirobot Are you able to simulate two robots and with no extra objects? As you work through your troubleshooting feel free to make contributions back about this issue. |
Yes, I am able to simulate two robots with no extra objects. It will show the error messages shown above though. I am trying to spawn a third robot will result in a segmentation fault that crashes the whole simulation. I also tested removing several topics I will not use, which did not help. In addition, trying to spawn more than two Create 3 (without the TurtleBot4 add ons) does not work either. |
@abdosalem490 It is possible to simulate several TurtleBot3s in Gazebo. We used it with up to 9 robots so far. |
The problem seems to be connected with the plugins and especially the sensors plugin. When including the turtlebot model in the SDF world file, I can spawn more than two robots when I remove the sensors-systems.so plugin but the simulation crashes if I include the sensors plugin again.
|
Excluding the sensors-system plugin from the robot model and including it only once in the world file fixes the problem. For this purpose, the create3 description (create3_sim/irobot_create_common/irobot_create_description/urdf/create3.urdf.xacro) has to be updated by removing the sensors-system plugin (in addition, I removed the contact-system plugin). Both plugins should be included in the world file, e.g. just after the other plugins. From my tests, the second robot is then spawned without the error messages reported above and I also was able to include a third robot without crashing the simulation. When using all sensors, the performance of the simulation will significantly drop when adding several robots. Removing unused sensor nodes from the create3_ros_ignition_bridge.launch.py can improve this. |
Yes I have tried many times, for two turtlebot4 it works fine but when you want to add more than two turtlebot4, then the gazebo ignition crashes. But I developed swarm of turtlebot3 in classic gazebo and implemented NAV2 and it works perfectly fine. Yes the turtlebot4 simulation and hardware implementation for multiple turtlebot4 is much difficult. |
@Kazimbalti Please see me comment above on how to fix the issue. I hope that there will be an official bug fix, but for now the workaround is well enough to get the simulation running. |
@Kazimbalti I am talking about the TB4 since this issue and repository is about the TB4. I know that the TB3 works fine (see my previous comment: #60 (comment)) |
@msminirobot Thank you for your prompt response, Sorry at that time I missed the your comments, thank you. Please can you explain a bit more, how you spawn more TB4, where is the sensors plugin? As in turtlebot4_description, there is only one launch file and in urdf there is are folders of standard and sensor, So which thing I have to remove or exclude. thank you |
@Kazimbalti The TB4 packages depend on the create3 packages (https://github.com/iRobotEducation/create3_sim/tree/main) since the TB4 is based on the create3. The modifications are to be done in the create3 packages. |
@msminirobot Thank you for your help, now the gazebo ignition is not crashing. After comments out the following: I got this in the third TB4 terminal: [lifecycle_manager-56] [INFO] [1702465625.421946453] [robot3.lifecycle_manager_navigation]: Waiting for service controller_server/get_state... While fourth TB4 is not spawn on the gazebo and I got the following message in terminal 4: @msminirobot Please guide me, how to resolve these issues and spawn more robots in Gazebo. thank you |
@msminirobot @hilary-luo |
@Kazimbalti Regarding the simulation, it is likely a local problem I cannot help you with. Regarding your second point: this issue is meant to solve errors in the code base regarding the simulation crash when spawning multiple turtlebots. For general support on using the ROS ecosystem and simulations, please use https://robotics.stackexchange.com |
The number of robots that can be spawned also depends heavily on the nodes created by the robots. There seems to be a hart limit of ~120 nodes. Preventing the launch of unused nodes from the create3 and the Turtlebot4 repos allows spawning more robots. Without excluding standard nodes, up to three robots can be spawned. |
@msminirobot, I really really like to thank you for posting the solution in this thread, I have been struggling with TB4 for a while and I gave up. so I started implementing my own robot but at some point, I realized it would require me a tedious amount of work to get it working with other packages like slam_toobox and nav2. I tried your solution and it worked like a charm. |
Also, it seems like spawning the robots by one launch script does not work (diff drive controller could not be configured then). Spawning them using separate launch files and individual terminals works though; each robot seems to require an own thread. |
Please provide the following information:
Expected behaviour
multiple Turtlebot4 spawned in the simulation
Actual behaviour
the simulation crashes
To Reproduce
Provide the steps to reproduce:
I am trying to simulate multiple turtlebot4 on Gazebo Fortress using ROS2 humble on my Ubuntu 22.04 but when I tried to run these commands, each in alone terminal:
the simulation crashes and I get the following logs:
Other notes
Add anything else you thing is important.
The text was updated successfully, but these errors were encountered: