Ask Your Question
0

Robot doesn't move in Gazebo

asked 2021-03-02 09:19:20 -0500

UndefinedDuck gravatar image

I'm trying to move my robot in Gazebo but when I publish the cmd_vel the robot doesn't move, should I add some plugin to gazebo? Or it's needed some control code in order to move the joints? I've searched some guides but I didn't find anything to solve my problem.

I also noticed that in the urdf file there is this plugin:

 <gazebo>
    <plugin filename="libgazebo_ros_control.so" name="gazebo_ros_control">
      <robotNamespace>/</robotNamespace>
    </plugin>
    <plugin filename="libgazebo_ros_force_based_move.so" name="object_controller">
      <robotNamespace>/</robotNamespace>
      <commandTopic>/movo/cmd_vel</commandTopic>
      <odometryTopic>/movo/odometry/wheel_odometry</odometryTopic>
      <odometryFrame>odom</odometryFrame>
      <odometryRate>100.0</odometryRate>
      <cmdVelTimeOut>0.2</cmdVelTimeOut>
      <robotBaseFrame>base_link</robotBaseFrame>
      <publishOdometryTf>0</publishOdometryTf>
      <yaw_velocity_p_gain>500.0</yaw_velocity_p_gain>
      <x_velocity_p_gain>10000.0</x_velocity_p_gain>
      <y_velocity_p_gain>10000.0</y_velocity_p_gain>
    </plugin>
    <plugin filename="libgazebo_ros_p3d.so" name="gazebo_ros_p3d">
      <bodyName>base_link</bodyName>
      <topicName>ground_truth_odom</topicName>
      <alwaysOn>true</alwaysOn>
      <updateRate>100.0</updateRate>
    </plugin>  
  </gazebo>

which has the /movo/cmd_vel topic, but I also tried to create a publisher called like that and robot doesn't move as well. I can't show all the urdf cause it's too long

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-03-03 03:06:20 -0500

loguna gravatar image

updated 2021-03-03 03:10:44 -0500

Hard to know what your prob is. But perhaps this video will help you.

https://www.youtube.com/watch?v=q01dD...

edit flag offensive delete link more

Comments

Please do not post link-only answers. Especially not to videos.

gvdhoorn gravatar image gvdhoorn  ( 2021-03-03 03:38:04 -0500 )edit

I was just following that guide, but I don't understand how to make my robot move, maybe because i'm using a 4 wheeled robot? Should I use a different plugin?

UndefinedDuck gravatar image UndefinedDuck  ( 2021-03-03 05:22:19 -0500 )edit

maybe should check on ackermann_steering_controller

loguna gravatar image loguna  ( 2021-03-03 05:54:54 -0500 )edit

I found the problem, urdf file is missing wheels joint informations, so now I added 2 temporary wheels and it's moving! But I don't know why if I stop the cmd_vel topic the robot keeps moving

UndefinedDuck gravatar image UndefinedDuck  ( 2021-03-03 06:22:48 -0500 )edit

That good. It just the way the cmd_vel works The program will store the latest cmd_vel value that it had subscribe to. Hence even if you close the topic, the stored value is there. That why you will have to command the robot to stop moving.

loguna gravatar image loguna  ( 2021-03-03 06:26:46 -0500 )edit

Ok got it, but when I spawn the robot it isn't immobile but it moves a bit. Edit: I increased the mass of the wheels and now it's good, thank you

UndefinedDuck gravatar image UndefinedDuck  ( 2021-03-03 06:31:07 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2021-03-02 09:19:20 -0500

Seen: 207 times

Last updated: Mar 03