Robot with ackermann controller not moving

asked 2023-04-03 06:51:01 -0500

Edvard gravatar image

updated 2023-04-10 01:31:28 -0500

Hi. Sorry for all mistakes, English is not my native language. I have a robot with four_wheel_steering_controller and it's works fine now. I want to port my project from Noetic to ROS2, and on ROS2 there are no four_wheel_steering_controller but there are tricycle_controller that is very alike to ackermann. I, for test purposes, want to change my robot to use ackermann on Noetic to avoid small mistakes, but for not so obvious reasons for me, my robot is not moving. I changed my urdf description and controller settings with this project as example. I know that it's for Melodic, but I couldn't find any over examles that don't implement additional code.

This is my settings files. ackermann_controller.yaml:

joint_state_controller:
    type: joint_state_controller/JointStateController
    publish_rate: 50

myrobot:
  controller:
    type: "ackermann_steering_controller/AckermannSteeringController"
    rear_wheel  : 'rear_base_steer_joint'
    front_steer : 'front_base_steer_joint'
    publish_rate: 50.0 # defaults to 50

    pose_covariance_diagonal: [0.001, 0.001, 0.001, 0.001, 0.001, 0.03]
    twist_covariance_diagonal: [0.001, 0.001, 0.001, 0.001, 0.001, 0.03]
    cmd_vel_timeout: 5.0 # we test this separately, give plenty for the other tests

    base_frame_id: world_kink
    enable_odom_tf: false

    wheel_separation_h : 0.4

move_base:
  GlobalPlanner:
    allow_unknown: False

and ackermann_controller_gazebo_harware.yaml:

myrobot_hardware_ackermann:
  rear_wheel  : 'rear_base_steer_joint'
  front_steer : 'front_base_steer_joint'

  virtual_rear_wheels: ['rear_right_wheel_joint', 'rear_left_wheel_joint']
  virtual_front_wheels: ['front_right_wheel_joint', 'front_left_wheel_joint']
  virtual_front_steers: ['front_right_steer_joint', 'front_left_steer_joint']

  enable_ackermann_link : true
  wheel_separation_h : 0.4

This is launch file for simulation:

<?xml version="1.0"?>
<launch>


  <!-- Load joint controller configurations from YAML file to parameter server -->
  <rosparam command="load" file="$(find myrobot_control)/config/ackermann_controller.yaml"/>
  <rosparam command="load" file="$(find myrobot_control)/config/ackermann_controller_gazebo_harware.yaml"/>
  <param name="/myrobot/controller/enable_odom_tf" value="true"/>

  <!-- Spawn controller -->
  <node args="/myrobot/controller /joint_state_controller" name="controller_spawner" output="screen" pkg="controller_manager" type="spawner"/>
  <param command="xacro --inorder '$(find myrobot_simulator)/urdf/myrobot.gazebo.xacro'" name="robot_description"/>
  <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"/>

  <!-- Load mux -->
  <include file="$(find myrobot_control)/launch/mux.launch" />
</launch>

and this is log from terminal:

[ INFO] [1680521358.966979645, 1099.830000000]: Loading gazebo_ros_control plugin
[ INFO] [1680521358.967516534, 1099.830000000]: Starting gazebo_ros_control plugin in namespace: /
[ INFO] [1680521358.970282405, 1099.830000000]: gazebo_ros_control plugin is waiting for model URDF in parameter [robot_description] on the ROS param server.
[ERROR] [1680521359.108993716, 1099.830000000]: No p gain specified for pid.  Namespace: /gazebo_ros_control/pid_gains/front_base_steer_joint
[ERROR] [1680521359.111335373, 1099.830000000]: No p gain specified for pid.  Namespace: /gazebo_ros_control/pid_gains/rear_base_steer_joint
[ERROR] [1680521359.114589373, 1099.830000000]: No p gain specified for pid.  Namespace: /gazebo_ros_control/pid_gains/front_left_steer_joint
[ERROR] [1680521359.168986295, 1099.830000000]: No p gain specified for pid.  Namespace: /gazebo_ros_control/pid_gains/front_right_steer_joint
[ INFO] [1680521359.300524693, 1099.830000000]: Loaded gazebo_ros_control.
[ INFO] [1680521359.320900156, 1099.849000000]: Mode changed: LIMIT
[ WARN] [1680521359.462890242, 1099.971000000]: No sensor messages received for a 1099.971000 seconds (timeout=0.500000)!
[ INFO] [1680521359.462993608, 1099.971000000]: SensorStatus changed: INVALID
[INFO] [1680521359.467225, 1099.974000]: Controller Spawner: Waiting for service controller_manager/switch_controller
[INFO] [1680521359.484073, 1099.985000]: Controller Spawner: Waiting for service controller_manager/unload_controller
[INFO] [1680521359.490489, 1099.985000]: Loading controller: /minicar/controller
[ INFO] [1680521359 ...
(more)
edit retag flag offensive close merge delete