Robotics StackExchange | Archived questions

Please set required_drive_mode(s) for controller ackermann_controller

Hello,

I am getting an error trying to run the ackermann_controller from ros control, and can't seem to debug..

[ INFO] [1524868706.395007170]: Found spinning joint bl_wheel_joint with lateral deviation 0 and radius 0.02
[ INFO] [1524868706.395276706]: Found spinning joint br_wheel_joint with lateral deviation 0 and radius 0.02
[ INFO] [1524868706.395410981]: Found odometry joint bl_wheel_joint with lateral deviation 0 and radius 0.02
[ INFO] [1524868706.395618399]: Found odometry joint br_wheel_joint with lateral deviation 0 and radius 0.02
[ INFO] [1524868706.395748424]: Found odometry joint fl_rotation_joint with lateral deviation 0 and radius 0.05
[ INFO] [1524868706.395854782]: Found odometry joint fr_rotation_joint with lateral deviation 0 and radius 0.05
[ INFO] [1524868706.395981651]: Found steering joint fl_rotation_joint with lateral deviation 0
[ INFO] [1524868706.396209097]: Found steering joint fr_rotation_joint with lateral deviation 0
[ERROR] [1524868706.516831750]: Please set required_drive_mode(s) for controller ackermann_controller
[ERROR] [1524868706.516966469]: Could not switch controllers. The hardware interface combination for the requested controllers is unfeasible.

The following are the launch files i am launching:

<launch>
  <param name="robot_description" command="$(find xacro)/xacro --inorder '$(find nexus_description)/urdf/real_robot.urdf.xacro'" />
  <node name="can_driver" pkg="canopen_motor_node" type="canopen_motor_node" output="screen" clear_params="true" launch-prefix="">
     <rosparam command="load" file="$(find nexus_robot)/config/can0.yaml" />
     <rosparam command="load" file="$(find nexus_robot)/config/4wheel_ackermann_driver.yaml" />
  </node>
<?xml version="1.0"?>
<launch>

  <!-- send urdf to param server -->
  <!-- robot state publisher -->
  <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher">
      <param name="publish_frequency" type="double" value="50.0" />
      <param name="tf_prefix" type="string" value="" />
  </node>

  <!-- Load joint controller configurations from YAML file to parameter server -->
  <rosparam file="$(find nexus_controller)/config/ackermann_control.yaml" command="load"/>

  <node name="base_controller_spawner" pkg="controller_manager" type="controller_manager" args="spawn joint_state_controller fr_rotation_joint_position_controller br_wheel_joint_velocity_controller bl_wheel_joint_velocity_controller fl_rotation_joint_position_controller" respawn="false" output="screen"/>

  <node name="joint_states_relay" pkg="topic_tools" type="relay" args="joint_states /joint_states" cwd="node" respawn="true" output="screen"/>

</launch>

</launch>                                                                                                                                                                                                                                                                                                                              

And the following are the corresponing yaml files:

can0.yaml

bus:
  device: can0
sync:
  interval_ms: 10

4wheelackermanndriver.yaml:

name: nexus

defaults:
  eds_pkg: nexus_robot
  motor_layer:
    switching_state: 4
  #the following scaling is due to 16bit value range limitation of velocity command in vl mode (2)
  #dcf_overlay: # "ObjectID": "ParameterValue" (both as strings)
  #  "604Csub1": "1" # vl dimension factor numerator
  #  "604Csub2": "24000" # vl dimension factor denominator

nodes:
  br_wheel_joint:
    id: 6
    eds_file: "config/N5-2-2.eds"
    vel_to_device: "rint((vel))"
    vel_from_device: "(obj606C)"
  bl_wheel_joint:
    id: 8
    eds_file: "config/N5-2-2.eds"
    vel_to_device: "rint((vel))"
    vel_from_device: "(obj606C)"
  fr_rotation_joint:
    id: 3
    eds_file: "config/PD6-CB87S048030-E-09.eds"
    pos_to_device: "rint(1000*(pos))"
    pos_from_device: "(obj6064)/1000"
  br_rotation_joint:
    id: 5
    eds_file: "config/PD6-CB87S048030-E-09.eds"
    pos_to_device: "rint(1000*(pos))"
    pos_from_device: "(obj6064)/1000"
  bl_rotation_joint:
    id: 7
    eds_file: "config/PD6-CB87S048030-E-09.eds"
    pos_to_device: "rint(1000*(pos))"
    pos_from_device: "(obj6064)/1000"
  fl_rotation_joint:
    id: 1
    eds_file: "config/PD6-CB87S048030-E-09.eds"
    pos_to_device: "rint(1000*(pos))"
    pos_from_device: "(obj6064)/1000"

4wheel_canopen.launch

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

  <param name="robot_description" command="$(find xacro)/xacro --inorder '$(find nexus_description)/urdf/real_robot.urdf.xacro'" />
  <node name="can_driver" pkg="canopen_motor_node" type="canopen_motor_node" output="screen" clear_params="true" launch-prefix="">
     <rosparam command="load" file="$(find nexus_robot)/config/can0.yaml" />
     <rosparam command="load" file="$(find nexus_robot)/config/4wheel_ackermann_driver.yaml" />
  </node>

</launch>

ackermann_control.yaml

## joint_names
joint_names: [fr_rotation_joint, fr_wheel_joint, br_rotation_joint, br_wheel_joint, bl_rotation_joint, bl_wheel_joint, fl_rotation_joint, fl_wheel_joint]

## joint_state_controller
joint_state_controller:
    type: joint_state_controller/JointStateController
    publish_rate: 50

fr_rotation_joint_position_controller:
  type: position_controllers/JointPositionController
  joint: fr_rotation_joint
  required_drive_mode: 1

br_wheel_joint_velocity_controller:
  type: velocity_controllers/JointVelocityController
  joint: br_wheel_joint
  required_drive_mode: 3

bl_wheel_joint_velocity_controller:
  type: velocity_controllers/JointVelocityController
  joint: bl_wheel_joint
  required_drive_mode: 3

fl_rotation_joint_position_controller:
  type: position_controllers/JointPositionController
  joint: fl_rotation_joint
  required_drive_mode: 1


ackermann_controller:

      type: ackermann_controller/AckermannController
      spinning_joints: ['bl_wheel_joint', 'br_wheel_joint']
      steering_joints: ['fl_rotation_joint', 'fr_rotation_joint']
      odometry_joints: ['bl_wheel_joint', 'br_wheel_joint', 'fl_rotation_joint', 'fr_rotation_joint']
      publish_rate: 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: 25.0 # not tested here

      # Base frame_id
      base_frame_id: base_footprint
      wheelradius: 0.1524
      wheelbase: 1.637284 
      # Odometry fused with IMU is published by robot_localization, so
      # no need to publish a TF based on encoders alone.
      enable_odom_tf: true

      linear:
         x:
             has_velocity_limits    : true
             max_velocity           : 1.0   # m/s
             has_acceleration_limits: true
             max_acceleration       : 5.0   # m/s^2

      angular:
         z:
             has_velocity_limits    : true
             max_velocity           : 1.0   # rad/s
             has_acceleration_limits: true
             max_acceleration       : 10.0   # rad/s^2

SO, its asking for requireddrivemode for the ackermann controller, but there are several drive modes on the robot, position for the steering, and velocity for the wheels.. im not sure how to configure this.

Asked by JadTawil on 2018-04-27 18:10:57 UTC

Comments

Answers