Questions about ros_control
I have 4 wheeled robot and I want to load ros_control but I have few questions that I do not understand.
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?
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"> <type>transmission_interface/SimpleTransmission</type> <joint name="${position}_wheel_joint"> <hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface> </joint> <actuator name="${position}_wheel_actuator"> <hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface> <mechanicalReduction>1</mechanicalReduction> </actuator> </transmission>
And included ros_control:
<gazebo>
<plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
<robotNamespace>/genius</robotNamespace>
</plugin>
</gazebo>
Then which config file do I need to use? I am confused here. I have 2 files, the first one is:
genius:
# Publish all joint states -----------------------------------
# Creates the /joint_states topic necessary in ROS
joint_state_controller:
type: joint_state_controller/JointStateController
publish_rate: 30
# Effort Controllers ---------------------------------------
left_top_wheel_effort_controller:
type: effort_controllers/JointEffortController
joint: tl_wheel_joint
pid: {p: 100.0, i: 0.1, d: 10.0}
left_bot_wheel_effort_controller:
type: effort_controllers/JointEffortController
joint: bl_wheel_joint
pid: {p: 100.0, i: 0.1, d: 10.0}
right_top_wheel_effort_controller:
type: effort_controllers/JointEffortController
joint: tr_wheel_joint
pid: {p: 100.0, i: 0.1, d: 10.0}
right_bot_wheel_effort_controller:
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:
genius_joint_publisher:
type: "joint_state_controller/JointStateController"
publish_rate: 30
genius_velocity_controller:
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