ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Gazebo model messed up with ros_control & JointVelocityController

asked 2018-10-06 12:16:01 -0600

kiranpalla gravatar image

updated 2018-10-07 05:31:46 -0600

gvdhoorn gravatar image

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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-10-07 14:07:35 -0600

kiranpalla gravatar image

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.

edit flag offensive delete link more

Comments

Hi! I met the same issue, but still can't solve it. Please, show your URDF

standmit gravatar image standmit  ( 2020-01-16 18:44:30 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2018-10-06 12:16:01 -0600

Seen: 416 times

Last updated: Oct 07 '18