Robot with ackermann controller not moving
Hi. Sorry for all mistakes, English is not my native language. I have a robot with fourwheelsteeringcontroller and it's works fine now. I want to port my project from Noetic to ROS2, and on ROS2 there are no fourwheelsteeringcontroller 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 ackermanncontrollergazebo_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.584092527, 1100.048000000]: Controller state will be published at 50Hz.
[ INFO] [1680521359.585404092, 1100.052000000]: SensorStatus changed: VALID
[ INFO] [1680521359.586443460, 1100.054000000]: Wheel separation height will be multiplied by 1.
[ INFO] [1680521359.587305867, 1100.054000000]: Wheel radius will be multiplied by 1.
[ INFO] [1680521359.588024297, 1100.054000000]: Steer pos will be multiplied by 1.
[ INFO] [1680521359.589187184, 1100.055000000]: Velocity rolling window size of 10.
[ INFO] [1680521359.592689597, 1100.057000000]: Velocity commands will be considered old if they are older than 5s.
[ INFO] [1680521359.595793598, 1100.059000000]: Allow mutiple cmd_vel publishers is enabled
[ INFO] [1680521359.597733685, 1100.059000000]: Base frame_id set to rs_t265_pose_frame
[ INFO] [1680521359.598402636, 1100.059000000]: Odometry frame_id set to odom
[ INFO] [1680521359.600444111, 1100.062000000]: Publishing to tf is enabled
[ INFO] [1680521359.621570406, 1100.079000000]: Retrieved wheel_radius: 0.001
[ INFO] [1680521359.622233785, 1100.079000000]: Odometry params : wheel separation height 0.4, wheel radius 0.001
[ INFO] [1680521359.631542421, 1100.086000000]: Adding the rear wheel with joint name: rear_base_steer_joint
[ INFO] [1680521359.634094561, 1100.088000000]: Adding the front steer with joint name: front_base_steer_joint
[ INFO] [1680521359.634454320, 1100.088000000]: Adding the subscriber: cmd_vel
[ INFO] [1680521359.647090232, 1100.098000000]: Finished controller initialization
[INFO] [1680521359.650378, 1100.101000]: Loading controller: /joint_state_controller
[INFO] [1680521359.688714, 1100.130000]: Controller Spawner: Loaded controllers: /minicar/controller, /joint_state_controller
[INFO] [1680521359.711633, 1100.143000]: Started controllers: /minicar/controller, /joint_state_controller
/opt/ros/noetic/lib/python3/dist-packages/tf/listener.py:97: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
data = yaml.load(self._buffer.all_frames_as_yaml()) or {}
I'm sorry, but I can't add here URDF description here but I change it acording to examle above. Appreciate any help.
EDIT. Appearantly, for simulation ackermann robot steerdriveros package is required, but there is no such package for Noetic or Foxy. Stil there are some ackermann simulations from Noetic on YouTube, but no source code linked, so how to solve this problem remains unknown for me, and I still appreceaite any hints or examples.
Asked by Edvard on 2023-04-03 06:51:01 UTC
Comments