I have a fresh installation of Ubuntu 22.04 in a VM VirtualBox, fully updated. I compiled Gazebo Harmonic from source code and followed the "Building your own robot" tutorial creating the building_robot.sdf and then move the vehicle with the keyboard...
The problem is that when, from another terminal I type the command:
gz topic -t "/cmd_vel" -m gz.msgs.Twist -p "linear: {x: 0.5}, angular: {z: 0.05}"
the message does not reach Gazebo and the vehicle does not move. But if you keep on sending the same command about 10 - 12 times, all of a sudden the vehicle starts to move...!
This is my diff-drive configuration:
<plugin
filename="gz-sim-diff-drive-system"
name="gz::sim::systems::DiffDrive">
<left_joint>left_wheel_joint</left_joint>
<right_joint>right_wheel_joint</right_joint>
<wheel_separation>1.2</wheel_separation>
<wheel_radius>0.4</wheel_radius>
<odom_publish_frequency>1</odom_publish_frequency>
<topic>cmd_vel</topic>
</plugin>
</model>
Can someone pls explain why this is so? What am I missing or doing wrong?
Thanks in advance for any suggestions,
Marco
gz topic --list
to see if/cmd_vel
is present. Also make sure gazebo is running (playing) and the DiffDrive plugin is loaded. And please share your plugin config. $\endgroup$gz topic --info /cmd_vel
to make sure there is a subscriber for the topic. This is the DiffDrive plugin. The delay you are experiencing might just be a delay in starting the simulation. The robot will not move until you push the "play" button in gazebo or if you have autostart enabled. $\endgroup$