0
$\begingroup$

I was following the Nav2 tutorial for setting up a robot which works as expected for a diff drive (the white front wheels are due to diffdrive not publishing transformation for these, that's ok):

enter image description here

Then, i replaced the diffdrive plugin for my use case with the ackermann plugin, however, all transformations are empty and the wheels/links all collapse to the base_link:

enter image description here

Using my URDF and with the joint_state_publisher_gui without Gazebo works as expected:

enter image description here

The plugin is set up as specified in its docs:

    <gazebo>
      <plugin name="gazebo_ros_ackermann_drive" filename="libgazebo_ros_ackermann_drive.so">
        <ros>
          <namespace>/demo</namespace>
          <!-- <remapping>cmd_vel:=cmd_demo</remapping> -->
          <!-- <remapping>odom:=odom_demo</remapping> -->
          <!-- <remapping>distance:=distance_demo</remapping> -->
          <!-- <parameter name="cmd_vel_topic" value="cmd_demo"/> -->
          <!-- <parameter name="odom_topic" value="odom_demo"/> -->
          <!-- <parameter name="distance_topic" value="distance_demo"/> -->
        </ros>
        <update_rate>100.0</update_rate>

        <!-- wheels -->
        <front_left_joint>front_left_wheel_joint</front_left_joint>
        <front_right_joint>front_right_wheel_joint</front_right_joint>
        <rear_left_joint>rear_left_wheel_joint</rear_left_joint>
        <rear_right_joint>rear_right_wheel_joint</rear_right_joint>
        <left_steering_joint>front_left_steer_joint</left_steering_joint>
        <right_steering_joint>front_right_steer_joint</right_steering_joint>
        <steering_wheel_joint>steering_joint</steering_wheel_joint>

        <!-- Max absolute steer angle for tyre in radians-->
        <!-- Any cmd_vel angular z greater than this would be capped -->
        <max_steer>0.6458</max_steer>

        <!-- Max absolute steering angle of steering wheel -->
        <max_steering_angle>7.85</max_steering_angle>

        <!-- Max absolute linear speed in m/s -->
        <max_speed>20</max_speed>

        <!-- PID tuning -->
        <left_steering_pid_gain>1500 0 1</left_steering_pid_gain>
        <left_steering_i_range>0 0</left_steering_i_range>
        <right_steering_pid_gain>1500 0 1</right_steering_pid_gain>
        <right_steering_i_range>0 0</right_steering_i_range>
        <linear_velocity_pid_gain>1000 0 1</linear_velocity_pid_gain>
        <linear_velocity_i_range>0 0</linear_velocity_i_range>

        <!-- output -->
        <publish_odom>true</publish_odom>
        <publish_odom_tf>true</publish_odom_tf>
        <publish_distance>true</publish_distance>

        <!-- disable tf -->
        <publish_wheel_tf>true</publish_wheel_tf>


        <odometry_frame>odom</odometry_frame>
        <robot_base_frame>base_link</robot_base_frame>
      </plugin>
    </gazebo>

If someone has a suggestion why diffdrive works as expected and ackermann does not, i would highly appreciate some pointers, i already excluded the STL bug in the ackermann plugin.

$\endgroup$

1 Answer 1

0
$\begingroup$

I updated all inertias, collision model and made them reasonble in magnitude, that helped

$\endgroup$
2
  • $\begingroup$ What do you mean by reasonable? Any examples or exact figures? $\endgroup$ Commented Aug 16 at 15:47
  • $\begingroup$ Sorry, I am unable to reproduce what exactly caused this but I saw some NaN entries $\endgroup$ Commented Aug 17 at 16:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.