I'm facing a peculiar issue with Gazebo and ROS2 integration, where a truck model does not move as expected when inserted into the environment automatically via a launch file, contrary to its behavior when inserted manually.
Environment
- ROS2 Iron
- Gazebo 11.10.2
- Ubuntu 22.04
Problem Description:
I have a custom world in Gazebo, which includes the Sonoma Raceway model. I also have a truck model (SDF format) that I need to insert into this world. When I manually insert the Sonoma Raceway model followed by the truck model into an empty Gazebo world, the truck can move without issues.
However, when I try to automate this process using a ROS2 launch file, where the world (with the raceway and truck models included) is loaded at the start, the truck does not move.
Attempts:
- Custom Ground Plane: I tried adding a custom ground plane with specific friction properties to the world file, but it did not resolve the issue.
- Delaying Truck Insertion: I experimented with delaying the truck model's insertion to simulate manual insertion (using time.sleep() in Python), but it was not effective.
- Adjusting Friction Properties: I modified the SDF files of both the raceway and the truck model to adjust friction properties, with no success.
- Launch File Modifications: I made several changes to the launch file to try different approaches for spawning the truck model, including using spawn_entity.py from gazebo_ros.
Code Samples:
World File: https://pastebin.com/w18v0ccm
Launch File: https://pastebin.com/ceqREdAs
Observations:
- The truck moves as expected when inserted manually.
- No error messages in the console that point to the cause.
- The issue seems related to how the models are loaded into Gazebo via the launch file.
Request for Help:
I'm looking for insights into what might be causing this behavior and how to resolve it. Any suggestions on how to ensure the truck moves as expected when the environment is set up automatically would be greatly appreciated.
Additional Materials:
The video link below is showing the manual insertion and movement process and the automated setup (truck does not move issue) for better clarity.
Troubleshooting Movement Issues in Gazebo: Manual vs. Automated Model Insertion"
Thank you in advance for your time and assistance!