ROS Control

What

  • ...is ROS Control?
  • ...are the benefits?
  • ...are the pieces?
  • ...is available?
  • ...is left to do?

or

What in the world has Clint been working on?

What is ROS Control?

An abstraction between controllers and hardware

Why switch?

  • no single monolith
  • implement individual controllers
  • register controllers at launch
  • safely switch controllers at runtime
  • integrate different hardware into same control loop

Components

  • hardware communication
  • hardware interfaces
  • controllers
  • a control loop
  • controller_manager (provided by ros_control)

libbarrett

Barrett's C++ library for communicating with the

WAM and BarrettHand

CANBus

  • libbarrett uses pcan_net
  • OWD uses pcan_char

barrett_ros_control

  • library of ros_control hardware interfaces for Barrett Products
  • binary that loads configuration and runs our control loop

The control loop breaks hardware communication into "tasks" that can be configured to run every N control cycles.

pr_ros_controllers

  • Controllers and messages that aren't available elsewhere
  • REWD (ROS Effort With Dynamics) controllers
  • Separate message package for easy installation

REWD Controllers

  • incorporates inverse dynamics in control loop
    • accurate execution, even at speed
    • enables more control modes, including gravity compensation

ros_control_client

  • Python library for using the controller_manager and pr_ros_controllers
  • Adapted from adapy
  • Integrated into prpy and herbpy

controller_manager

  • swaps loaded controllers intelligently and "safely"
    • intelligently in that conflicting controllers are stopped automatically
    • safely: no gap between controllers
    • not safe: will gleefully unload critical controllers if asked

with ros_conrol_client:

  • ros_control_client remembers which controllers were stopped so can appropriately start them again
  • uses Python's with statement for this
  • can also handle switching manually

Decomposed

pr_ros_controllers

barrett_ros_control

libbarrett

ros_control controllers

  • Joint State Controller
  • Joint Trajectory Controller
  • Joint Group Effort Controller
  • Force Torque Sensor Controller

our controllers

  • REWD Gravity Compensation Controller
  • REWD Joint Group Position Controller
  • Position Command Controller
  • Trigger Controller

Multiple Controllers:

HERB example

  • joint_state_controller
  • right_hand_controller
  • force_torque_sensor_controller
  • right_tare_controller
  • right_gravity_compensation_controller

On Herb

  • Services
    • /controller_manager/list_controller_types
    • /controller_manager/list_controllers
    • /controller_manager/load_controllers
    • /controller_manager/unload_controllers
    • /controller_manager/switch_controllers

On Herb

  • Action Topics
    • /right_hand_controller/set_position/goal
    • /right_joint_group_position_controller/command/goal
    • /right_trajectory_controller/follow_joint_trajectory/goal
    • /bimanual_trajectory_controller/follow_joint_trajectory/goal
    • /right_tare_controller/trigger/goal

 

And left equivalents

On Herb

  • Topics
    • /joint_state
    • /force_torque_sensor_controller/right/ft_wrench

Talk is cheap. Show me the code.

— Linus Torvalds

launching

ssh prdemo@herb0
screen -S ros_control

# will launch controller_manager and grav comp
roslaunch herb_launch ros_control.launch

rosservice call /controller_manager/list_controllers

herbpy

# no change to basic functionality but 
# ExecuteTrajectory will automatically load correct controller
traj = robot.right_arm.PlanToNamedConfiguration('home')
robot.ExecutePath(traj)

# manually set grav-comp/position control
robot.right_arm.SetStiffness(True)  
# == SetStiffness(1) == SetStiffness(0.001)

# get some information
ft = robot.right_hand.GetForceTorque()

herbpy

# NotImplementedError: 
# Servoing and velocity control not yet supported
# under ros_control
robot.right_arm.Servo(vels)

# NotImplementedError: 
# GetBreakaway is not yet implemented under ros_control
baw = robot.right_hand.GetBreakaway()

# NotImplementedError: 
# The head is currently disabled under ros_control
robot.head.MoveTo([0.0, 0.3])

not implemented

prpy + ros_control_client

from prpy.controllers import RewdOrTrajectoryController
from ros_control_client_py import ControllerManagerClient

robot =  # ... herb
timed_traj =  # ...

ctrl_manager = ControllerManagerClient()


with ctrl_manager.request('right_trajectory_controller'):
    ctrl = RewdOrTrajectoryController(
            robot, 
            'right_trajectory_controller',
            robot.right_arm.GetJointNames())
    ctrl.SetPath(timed_traj)
    prpy.util.WaitForController(ctrl, timeout=20)

What's left to be done?

  • More REWD Controllers
    • Trajectory Controller
    • Move Until Touch Controller
    • Joint Group Velocity Controller
    • Sustained Force Controller

What's left to be done?

  • More hardware support
    • new head
    • finger strain guages
    • finger breakaway
    • hand tactile sensors

What's left to be done?

  • C++ controller_manager API
  • aikido Executor integration
  • Barrett auto-tensioning script

What's left to be done?

TESTING!!!

And that means you!

ros_control

By Clint Liddick

ros_control

  • 1,427