ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

These are the steps I currently do:

Step 1: ros2 launch robot_v1 launch_robot.launch.py

[robot_state_publisher-1] Parsing robot urdf xml string. [robot_state_publisher-1] Link base_footprint had 0 children [robot_state_publisher-1] Link chassis had 2 children [robot_state_publisher-1] Link caster_wheel had 0 children [robot_state_publisher-1] Link laser_frame had 0 children [robot_state_publisher-1] Link left_wheel had 0 children [robot_state_publisher-1] Link right_wheel had 0 children Step 2: launch rviz2

Step 3: launch ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -r /cmd_vel:=/diff_cont/cmd_vel_unstamped

Step 4: List my topics ros2 topic list

/diff_cont/cmd_vel_unstamped
/dynamic_joint_states /joint_states
/odom /parameter_events
/robot_description /rosout /tf
/tf_static

Step 5: Show velocity used with teleop ros2 topic echo /diff_cont/cmd_vel_unstamped linear: x: 0.5 y: 0.0 z: 0.0 angular: x: 0.0 y: 0.0 z: 0.0

Step 6: The big error is here ros2 topic echo /odom

header: stamp: sec: 1683055943 nanosec: 697278387 frame_id: odom child_frame_id: base_link pose: pose: position: x: -1.2107849808063793 y: -0.08094175530158954 z: 0.0 orientation: x: 0.0 y: 0.0 z: 0.06693663980673284 w: 0.9977572281128229 twist: twist: linear: x: -2.0595504468534641e-16 y: 0.0 z: 0.0 angular: x: 0.0 y: 0.0 z: 2.1163626406917045e-17

Now I don't know how to solve this part. The wheels of my robot go in the correct direction when using the teleoperation from the keyboard and in gazebo it works well. Now, I have noticed that on some occasions the linear velocity in twist appears as positive but the position in pose appears in negative. I have changed the orientation of the axes and I think the problem is worse, because the wheels rotate in the opposite direction but the robot's pose always goes negative on the x axis if I want to move forward