The robot doesn't move when I use turtle_teleop_key
I want to connect ROS with Gazebo, to do it I'm following this tutorial: Robotic simulation scenarios with Gazebo and ROS.
And running ROS Lunar version 1.13.6 on an Ubuntu Xenial 16.04.4 LTS.
I did everything in the tutorial until the section Adding a camera. But when I do:
rosrun turtlesim turtle_teleop_key /turtle1/cmd_vel:=/mybot/cmd_vel
The robot doesn't move. It only moves a little when a press down arrow key.
Maybe the problem is here, inside the mybot.gazebo file:
<gazebo>
<plugin name="differential_drive_controller" filename="libgazebo_ros_diff_drive.so">
<legacyMode>true</legacyMode>
<alwaysOn>true</alwaysOn>
<updateRate>100</updateRate>
<leftJoint>left_wheel_hinge</leftJoint>
<rightJoint>right_wheel_hinge</rightJoint>
<wheelSeparation>${chassisWidth+wheelWidth}</wheelSeparation>
<wheelDiameter>${2*wheelRadius}</wheelDiameter>
<torque>20</torque>
<commandTopic>mybot/cmd_vel</commandTopic>
<odometryTopic>mybot/odom_diffdrive</odometryTopic>
<odometryFrame>odom</odometryFrame>
<robotBaseFrame>footprint</robotBaseFrame>
</plugin>
</gazebo>
But I'm newbie and I don't know if there is something wrong here.
I have also tried:
rostopic pub -1 /mybot/cmd_vel geometry_msgs/Twist -- '[2.0, 0.0, 0.0]' '[0.0, 0.0, 1.8]'
But the robot doesn't move.
Do you know why the robot doesn't move? Well, it moves. When I press the down arrow key, the robot base move to the ground.
All the source code is in Github.
UPDATE
I get this warnings when I launch Gazebo:
DiffDrive(ns = //): missing <rosDebugLevel> default is na
DiffDrive(ns = //): missing <publishWheelTF> default is false
DiffDrive(ns = //): missing <publishWheelJointState> default is false
DiffDrive(ns = //): missing <wheelAcceleration> default is 0
DiffDrive(ns = //): missing <wheelTorque> default is 5
DiffDrive(ns = //): missing <odometrySource> default is 1
GazeboRosDiffDrive Plugin (ns = ) missing <publishTf>, defaults to 1
This is the rosrun rqt_graph rqt_graph output:
Try publishing more than once, ie remove --1 and add -r 10 (rate at 10 hz)
These things don't latch unless you tell them to, do just hitting it once probably won't result in motion. It's been a while since I did the turtle demo, but I think you have to hold key or press a few times to get moving