How to load ros_control

asked 2019-05-06 09:02:00 -0500

stevemartinov gravatar image

updated 2019-05-06 09:02:52 -0500

I have 4 wheeled robot and I want to load ros_control but I have few questions that I do not understand. 1. Why do we need ros_control in gazebo if odom is perfect and we do not need to convert m/s to effort anyway? Is it because it will be easier to translate all the code to the real robot?

  1. I have skid steer robot and I have described my 4 wheels with this joint:

    <joint name="${position}_wheel_joint" type="continuous"> <parent link="${parent}"/> <child link="${position}_wheel"/> <origin xyz="${X} ${Y} -${radius}" rpy="0 0 0"/> <axis xyz="0 1 0" rpy="0 0 0"/> <limit effort="64" velocity="2"/> <joint_properties damping="0.0" friction="0.0"/> </joint>

    <!-- Transmission -->
    <transmission name="${position}_wheel_trans">
        <joint name="${position}_wheel_joint">
        <actuator name="${position}_wheel_actuator">

And included ros_control:

    <plugin name="gazebo_ros_control" filename="">

Then which config file do I need to use? I am confused here. I have 2 files, the first one is:

  # Publish all joint states -----------------------------------
  # Creates the /joint_states topic necessary in ROS
    type: joint_state_controller/JointStateController
    publish_rate: 30  

  # Effort Controllers ---------------------------------------
    type: effort_controllers/JointEffortController
    joint: tl_wheel_joint
    pid: {p: 100.0, i: 0.1, d: 10.0}

    type: effort_controllers/JointEffortController
    joint: bl_wheel_joint
    pid: {p: 100.0, i: 0.1, d: 10.0}

    type: effort_controllers/JointEffortController
    joint: tr_wheel_joint
    pid: {p: 100.0, i: 0.1, d: 10.0}

    type: effort_controllers/JointEffortController
    joint: br_wheel_joint
    pid: {p: 100.0, i: 0.1, d: 10.0}

Which is PID and the second one:

  type: "joint_state_controller/JointStateController"
  publish_rate: 30

  type        : "diff_drive_controller/DiffDriveController"
  left_wheel  : ['tl_wheel_joint', 'bl_wheel_joint']
  right_wheel : ['tr_wheel_joint', 'br_wheel_joint']
  publish_rate: 30.0  # default: 50
  pose_covariance_diagonal : [0.001, 0.001, 1000000.0, 1000000.0, 1000000.0, 0.03]
  twist_covariance_diagonal: [0.001, 0.001, 1000000.0, 1000000.0, 1000000.0, 0.03]
  cmd_vel_timeout: 0.25

Which one should I use? Also no matter which I load, I get this error for each wheel:

No p gain specified for pid.  Namespace: /genius/gazebo_ros_control/pid_gains/br_wheel_joint
edit retag flag offensive close merge delete