Baxter Robot Raconteur Bridge

From sdk-wiki
Jump to: navigation, search


Summary

Host Baxter as a TCP service accessible by MATLAB, Java, C++, C#, VB, and Python on other Windows/Linux/OSX machines

Installation/Prerequisites

Required:

  • A development PC with 1.0.0 software
  • The Robot Raconteur Python library Robot Raconteur

Check out the baxter_rr_bridge package from github and make sure all scripts are executable:

    $ cd ~/ros_ws/src
    $ git clone https://github.com/ChopChopperDan/baxter_rr_bridge.git
    $ cd ~/ros_ws/src/baxter_rr_bridge/scripts
    $ chmod +x jointcontroller_host.py peripherals_host.py camera_host.py
    $ cd ~/ros_ws/
    $ catkin_make --pkg baxter_rr_bridge

Usage

Main documentation is in the baxter_rr_bridge git repository "BaxterBridge_Documentation.pdf". Each script hosts different aspects of the Baxter robot as a TCP service on the development PC's IP address through either the port denoted by the --port flag or as a randomly generated open port.

Clients can be in any of the supported languages for Robot Raconteur (C++, Java, C#, MATLAB, VB, Python, Octave) and on any of the supported operating systems (Windows 32 and 64 bit, Linux 32 and 64 bit, Mac OSX).

A very simple MATLAB script to connect to the peripherals host and alter the navigator state (assuming IP address is 192.168.1.100 and port is 9999):

    COMP = 'tcp://192.168.1.100'
    RR_HOST = ':9999/BaxterPeripheralService/BaxterPeripherals'
    baxter_periph = RobotRaconteur.Connect([COMP RR_HOST]);
   
    while (true)
        left_nav = baxter_periph.getNavigatorState('left')
        if (left_nav.ok_button > 0)
            led_on = left_nav.inner_led;
            led_on = uint8(led_on == 0);
            baxter_periph.setNavigatorLEDs('left',led_on,led_on);
        elseif (left_nav.cancel_button > 0)
            break;
        end
        pause(0.05)
    end
    RobotRaconteur.Disconnect(baxter_periph)

jointcontroller_host.py

    $ rosrun baxter_rr_bridge jointcontroller_host.py [--port p]

Hosts:

  • postion, velocity, and acceleration for all joints
  • position, orientation, twists, wrenches for both end effectors
  • joint controllers (position, velocity, and torque modes)

camera_host.py

    $ rosrun baxter_rr_bridge camera_host.py camera_name [--mode {0,1,2,3,4,5}] [--half_res {0,1}] [--port p]

Hosts:

  • opening/closing camera
  • camera controls like exposure, gain, white balance, fps
  • current camera image

peripherals_host.py

    $ rosrun baxter_rr_bridge peripherals_host.py [--port p]

Hosts:

  • electric gripper control
  • end-effector ranger and accelerometer data
  • head servo control
  • head sonar
  • background service suppression
  • gravity compensation torques
  • navigator / ITB data