At Wits End! Ackerman_Steering_Controller Not Working

asked 2020-03-15 00:27:53 -0500

CoachAllen gravatar image

No matter what I change with this I cannot get it to work and google for three days only ends in massive frustration.

First exhibit: The ackermann_steering_controller wiki

I have implemented both the complete and minimal yaml examples, but here's the snippet:

mobile_base_controller:
 type: "ackermann_steering_controller/AckermannSteeringController"
 rear_wheel: 'rear_wheel_joint'
 front_steer: 'front_steer_joint'
 pose_covariance_diagonal: [0.001, 0.001, 1000000.0, 1000000.0, 1000000.0, 1000.0]
 twist_covariance_diagonal: [0.001, 0.001, 1000000.0, 1000000.0, 1000000.0, 1000.0]

Now they point you to an outdated example with the cirkit_unit03. So clearly I stick to what the say is the most updated as demonstrated above.

Now if I understand this correctly, a HW and a Gazebo version of this is needed. I have the Gazebo version as follows:

mobile_base_controller:
  rear_wheel: 'rear_wheel_joint'
  front_steer: 'front_steer_joint'
  virtual_rear_wheels  : ['right_rear_axle', 'left_rear_axle']
  virtual_front_wheels : ['right_front_axle', 'left_front_axle']
  virtual_front_steers : ['right_steering_joint', 'left_steering_joint']

  # ackermann link mechanism
  enable_ackermann_link: true
  wheel_separation_w : 0.5 #Needs Measuring
  wheel_separation_h : 0.79 #Needs Measuring

Now I have used the outdated URDF files to model my mobile robot with the sudo front_steer_joint and rear_wheel_joint as directed here.

Here is my launch file:

<launch>

<!-- these are the arguments you can pass this launch file, for example paused:=true -->
<arg name="paused" default="false"/>
<arg name="use_sim_time" default="true"/>
<arg name="gui" default="true"/>
<arg name="headless" default="false"/>
<arg name="debug" default="false"/>
<arg name="model" default="$(find ursa_pig_description)/urdf/ursa_pig.urdf.xacro"/>

<!-- We resume the logic in empty_world.launch, changing only the name of the world to be launched -->
<include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="debug" value="$(arg debug)" />
    <arg name="gui" value="$(arg gui)" />
    <arg name="paused" value="$(arg paused)"/>
    <arg name="use_sim_time" value="$(arg use_sim_time)"/>
    <arg name="headless" value="$(arg headless)"/>
</include>

<group ns="/ursa_pig">
    <!-- Find the urdf file and load -->
    <param name="robot_description" command="$(find xacro)/xacro.py $(arg model)" />

    <!-- Find the steer bot params and load -->
    <rosparam file="$(find ursa_pig_control)/config/ursa_pig_joint_states.yaml" command="load"/>
    <rosparam file="$(find ursa_pig_control)/config/ursa_pig_hardware_config.yaml" command="load"/>
    <rosparam file="$(find ursa_pig_control)/config/ursa_pig_gazebo_config.yaml" command="load"/>
    <rosparam file="$(find ursa_pig_control)/config/pids.yaml" command="load"/>

    <node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false" output="screen" args="joint_state_controller mobile_base_controller" clear_params="true" />

    <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model" args="-z 1.0 -unpause -urdf -model robot -param robot_description" respawn="false" output="screen" clear_params="true"/>

    <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" clear_params="true" />
    <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
</group>

</launch>

Here is my URDF file:

<?xml version="1.0" ?>
<robot name="ursa_pig" 
  xmlns:xacro="http://www.ros.org/wiki/xacro">

  <!-- Degree-to-radian conversions -->
  <xacro:property name="degrees_45" value="0.785398163"/>
  <xacro:property name="degrees_90" value="1.57079633"/>
  <xacro:property name="degrees_180" value="3.14159265"/>

  <!-- Inertia Generator -->
  <xacro:macro name="default_inertial" params="mass ...
(more)
edit retag flag offensive close merge delete

Comments

Could it be that I am missing the ROBOT_HW and the RobotHWSim files?

CoachAllen gravatar image CoachAllen  ( 2020-03-15 18:36:35 -0500 )edit

I think I found out where I am being stupid. There is a need for a cpp file along with its header file companion. I can't believe it took me so long to find. Mark my words. I will create a tutorial for the wiki that is WAY more detailed once I succeed with this. I mean line for line... Do x, y, and z. So other ROS rookies won't struggle like myself.

667 lines of code to be written tomorrow.

Cheers,

CoachAllen gravatar image CoachAllen  ( 2020-03-15 21:13:28 -0500 )edit

Well that failed. That didn't work at all. Whats another week of struggle figuring ROS!????!?!?!?!?!

CoachAllen gravatar image CoachAllen  ( 2020-03-17 00:36:37 -0500 )edit

https://github.com/chrissunny94/acker...

This works , i am currently using this for my work . Its from Robotnic RBCAR .

I will document it further .

chrissunny94 gravatar image chrissunny94  ( 2020-04-20 03:00:54 -0500 )edit

@chrissunny94 this looks pretty cool so far!

CoachAllen gravatar image CoachAllen  ( 2020-05-31 20:07:45 -0500 )edit