Hello everybody,
We are using the Jackal robot from clearpath robotics for a project. We want to turn the default moving direction of the robot to the opposite. So the old forward direction should then be backwards. How can we achieve this?
We tried several things, but they did not work out.
Approach 1: We tried to change the base_link_joint of the urdf-model around 180°. After the turn of a coordinate frame around yaw=180°, the robot model behaves different in Rviz and Gazebo. If the model in Gazebo moves forward, the model in Rviz moves backwards.
<joint name="base_link_joint" type="fixed">
<origin xyz="0 0 0" rpy="0 0 ${PI}" />
<parent link="base_link"/>
<child link="chassis_link" />
</joint>
The original urdf-model can be found on https://github.com/jackal/jackal/blob/indigo-devel/jackal_description/urdf/jackal.urdf.xacro
Approach 2: Turn the direction of cmd_vel. We changed the sign of the x-value of cmd_vel to move in the opposite direction. This leads to the correct movements in Gazebo and Rviz, but the robot moves in the opposite direction of the goal (which is understandable).
We also tried the modifications on the real robot, but the problems were the same.
EDIT:
I found a solution for the simulated robot by modifying the urdf: I've turned the base_link_joint around 180° and all 4 wheels also around 180°. Rviz and Gazebo behave like they should.
<joint name="base_link_joint" type="fixed">
<origin xyz="0 0 0" rpy="0 0 ${PI}" />
<parent link="base_link"/>
<child link="chassis_link" />
</joint>
<xacro:wheel prefix="front_left">
<origin xyz="${-wheelbase/2} ${-track/2} ${wheel_vertical_offset}" rpy="0 0 ${PI}" />
</xacro:wheel>
But when I want to use the same solution for the real robot. It does not change the moving direction. The model in Rviz changes when switching between different urdf-configurations, but the direction of movement stays the same.
Does anyone has an idea why this happens? And a solution how the real robot can get the same behaviour as the simulated one?
EDIT:
We did not found a working solution how to turn the orientation. We switched the configuration of the modules on top of the robot, so that we can use the default forward direction of the system.
Thank you for your help!
Greetings,
mr
Originally posted by mr on ROS Answers with karma: 11 on 2016-12-06
Post score: 1