0
$\begingroup$

Rosanswers logo

Hello,

I am currently working on getting my car robot to work with Ros2. The current state of the robot can be found here: https://github.com/HarunTeper/CRMCE

I created a urdf for the robot model and implemented the plugins for the gazebo sensors and ackermann_drive. When I try to spawn the robot in an empty world (with the urdf_robot.launch.py launch file), there is no problem and I can control it by sending /cmd_vel commands.

However, when I add the world-file to the command

    launch.actions.ExecuteProcess(cmd=['gazebo', '--verbose', '-s', 'libgazebo_ros_factory.so', world], output='screen' ),

the robot wheels and steering wheel all reset to the base_link position and don't move. When I remove the world argument again, everything works fine and is shown properly in Rviz and Gazebo.

Does anyone know how to fix this problem or had a similar problem?

I am using Ros2 Foxy with Gazebo11 on Ubuntu 20.04. If you want to replicate it you need to move the sonoma_raceway model to your .gazebo models folder.


Originally posted by HarunTeper on ROS Answers with karma: 13 on 2021-06-25

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I solved it. I had to update the parameters in my .world file. Before it was:

<physics type='ode'>
  <max_step_size>0.01</max_step_size>
  <real_time_factor>1</real_time_factor>
  <real_time_update_rate>0</real_time_update_rate>
  <gravity>0 0 -9.8</gravity>
</physics>

and I changed it to

<physics type='ode'>
  <max_step_size>0.001</max_step_size>
  <real_time_factor>1</real_time_factor>
  <real_time_update_rate>1000</real_time_update_rate>
  <gravity>0 0 -9.8</gravity>
</physics>

I don't know why this happened, but this solved it for me. Now all wheels are published properly in Gazebo and Rviz, even when spawned in this world.


Originally posted by HarunTeper with karma: 13 on 2021-06-26

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.