Gazebo model messed up with ros_control & JointVelocityController
Using ros_control controller manager, I'm trying to actuate wheels of a differential drive 'car-like' robot in Gazebo. I would like to publish velocity commands on JointVelocityController
(of both wheels).
MYBOT_CONTROL.yaml
:
*// Publish all joint states
joint_state_controller:
type: joint_state_controller/JointStateController
publish_rate: 50
// Velocity Controllers
left_wheel_velocity_controller:
type: effort_controllers/JointVelocityController
joint: left_wheel_joint
pid: {p: 100.0, i: 0.01, d: 10.0}
right_wheel_velocity_controller:
type: effort_controllers/JointVelocityController
joint: right_wheel_joint
pid: {p: 100.0, i: 0.01, d: 10.0}*
In my launch file, the controller_manager is invoked :
<node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false" output="screen" args="left_wheel_velocity_controller right_wheel_velocity_controller joint_state_controller"/>
With above setup, the robot model in Gazebo is deformed. Left wheel, right wheel & caster all appear at the center of the robot base.
However, when I replace JointVelocityController
with JointPositionController
, the robot model appears fine.
With that background, a few questions-
- Is
JointVelocityController
supported by ros_control + Gazebo? - Is it the right way to control a diff drive robot?
Thanks
Asked by kiranpalla on 2018-10-06 12:16:01 UTC
Answers
Answering my own question..thanks @gvdhoorn for editing my original question.
I figured out that DiffDriveController is the right controller for my purpose, and it works with gazebo_ros_control
with a hardware_interface/VelocityJointInterface
in the <transmission>
tag of robot description.
### mybot_ros_control.yaml ###
# Joint State Controller
joint_state_controller:
type: joint_state_controller/JointStateController
publish_rate: 50
# Differential Drive Controller
mybot_base_controller:
type: "diff_drive_controller/DiffDriveController"
left_wheel: 'left_wheel_joint'
right_wheel: 'right_wheel_joint'
pose_covariance_diagonal: [0.001, 0.001, 1000000.0, 1000000.0, 1000000.0, 1000.0]
twist_covariance_diagonal: [0.001, 0.001, 1000000.0, 1000000.0, 1000000.0, 1000.0]
# Base frame_id
base_frame_id: base_footprint
Corresponding change to the launch command:
<node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false" output="screen" args="mybot_base_controller joint_state_controller"/>
Above updates provide /cmd_vel
topic to which velocity commands can be published to control the differential drive robot model in gazebo.
Asked by kiranpalla on 2018-10-07 14:07:35 UTC
Comments
Hi! I met the same issue, but still can't solve it. Please, show your URDF
Asked by standmit on 2020-01-16 19:44:30 UTC
Comments