how does the gazebo_ros_skid_steer_drive plugin make robot move

asked 2019-05-07 06:45:44 -0500

starcosmos gravatar image

I am new to gazebo.I have searched the question in here and anwser.ros ,but I don't find the anwser. I will be very sorry for the repeating if there is already an explanation. Recently I meet a strange problem.I design a four-wheels car and want to make it move by the gazebo_ros_skid_steer_drive plugin.Everything is right,but the linear velocity. When I input the command: rostopic pub cmd_vel geometry_msgs/Twist -r 3 -- '[2.0,0.0,0.0]' '[0.0, 0.0, 0.0]' I find my car move to the reverse direction . Namely if I want it move forward,it will move back(^_^#). my xacro file about the move is: <joint name="base_to_wheel1" type="continuous"> <parent link="base_link"/> <child link="wheel_1"/> <origin rpy="1.5707 0 0" xyz="0.1 0.15 0"/> <axis xyz="0 0 1"/> <limit effort="100" velocity="100"/> </joint>

<joint name="base_to_wheel2" type="continuous">
    <axis xyz="0 0 1" />
    <limit effort="100" velocity="100" />
    <parent link="base_link"/>
<child link="wheel_2"/>
<origin rpy="1.5707 0 0" xyz="-0.1 0.15 0"/>
</joint>

<joint name="base_to_wheel3" type="continuous">
    <parent link="base_link"/>
<axis xyz="0 0 1" />
<child link="wheel_3"/>
<origin rpy="1.5707 0 0" xyz="0.1 -0.15 0"/>
</joint>

<joint name="base_to_wheel4" type="continuous">
   <parent link="base_link"/>
<axis xyz="0 0 1" />
<child link="wheel_4"/>
<origin rpy="1.5707 0 0" xyz="-0.1 -0.15 0"/>
</joint>

<gazebo>
    <plugin name="skid_steer_drive_controller" filename="libgazebo_ros_skid_steer_drive.so">
        <alwaysOn>true</alwaysOn>
        <updateRate>100.0</updateRate>
        <robotNamespace>/</robotNamespace>
        <leftFrontJoint>base_to_wheel1</leftFrontJoint>
        <rightFrontJoint>base_to_wheel3</rightFrontJoint>
        <leftRearJoint>base_to_wheel2</leftRearJoint>
        <rightRearJoint>base_to_wheel4</rightRearJoint>
        <wheelSeparation>0.2</wheelSeparation>
        <wheelDiameter>0.1</wheelDiameter>
        <torque>2</torque>
        <commandTopic>cmd_vel</commandTopic>
        <robotBaseFrame>base_link</robotBaseFrame>
        <broadcastTF>1</broadcastTF>
    </plugin>
</gazebo>

I check my wheel and confirm that the front wheel joint and the rear joint are all right.Finally I find if I change the wheel joint's origin rpy to "-1.5707 0 0",the movement become right.

origin rpy="1.5707 0 0" xyz="-0.1 0.15 0" ------->> origin rpy="-1.5707 0 0" xyz="-0.1 0.15 0"

I guess the gazebo_ros_skid_steer_drive plugin make my car move forward through making the joint rotate. So I change the joint's roll , the move direction can be changed.But I couldn't find any file to confirm my suppose.Is there any explanation for the gazebo_ros_skid_steer_drive plugin?

edit retag flag offensive close merge delete