Difference between revisions of "RSDK Shell"

From sdk-wiki
Jump to: navigation, search
(Verify ability to ping robot.)
(Verify ability to ping robot.)
Line 68: Line 68:
==== Verify ability to ping robot. ====
==== Verify ability to ping robot. ====
Ping what you have [[RSDK-Shell#initialize previously]] set as your <code>robot_hostname</code>.
Ping what you have [[RSDK Shell#initialize previously]] set as your <code>robot_hostname</code>.
<source lang="bash">
<source lang="bash">
     $ ping <robot_hostname>
     $ ping <robot_hostname>

Revision as of 18:06, 6 March 2014


Outcome of this step

  • You have successfully initialized a shell giving you the ability to enable/disable Baxter.


To properly communicate with Baxter two way communication must occur between the robot and the development workstation. This requires correctly setting the development workstation's ROS Environment Variable. A convenience script, init.sh, has been created to properly set majority of the required environment variables. With proper usage, running init.sh will be the only step required to communicate with Baxter from any new shell instance.


1. Initialize your environment: For each new Terminal, substitute your robot's hostname or IP address for <robot_hostname>:

    $ cd ~/ros_ws
    $ ./init.sh <robot_hostname>

You will see that your current shell prompt will be prefixed with:

    [ros - http://<robot_hostname>:11311]username@machine$

This allows you to quickly view if you shell has been init'd or not, and to which robot you are currently addressing (<robot_hostname>)

2. Export your ROS_HOSTNAME or ROS_IP: For each new terminal, substitute your development workstation's hostname or IP address for <workstation_hostname>

    $ export ROS_HOSTNAME=<workstation_hostname>

Alternatively if your workstation_hostname is not resolvable to Baxter, you will be required to set your ROS_IP environment variable explicitly to your development workstation IP address.

    $ export ROS_IP=<workstation_ip_address>

Important ROS_HOSTNAME will take precedence over ROS_IP. If you choose to explicitly set your ROS_IP you must unset your ROS_HOSTNAME.

    $ unset ROS_HOSTNAME

For more information visit ROS_IP/ROS_HOSTNAME

3. Optional (Recommended) export ROS_HOSTNAME/ROS_IP to be persistent when starting a new shell (eliminates step 2, exporting ROS_IP/ROS_HOSTNAME for every new shell).

    $ echo "export ROS_HOSTNAME=<workstation_hostname>" >> ~/.bashrc
    = OR =
    $ echo "export ROS_IP=<workstation_ip_address>" >> ~/.bashrc
    $ source ~/.bashrc

Test your ability to command the robot

1. Build all the example code (only need to do this once):

    $ rosmake baxter --pre-clean

2. Enable the robot

    $ rosrun tools enable_robot.py -e

The robot is now active. You may now grasp Baxter's arms freely by grasping the cuffs at the hands.

2. Disable the robot

    $ rosrun tools enable_robot.py -d

You should visibly see Baxter's arms gently fall and will no longer have the ability to move the arms freely.


Verify ability to ping robot.

Ping what you have RSDK Shell#initialize previously set as your robot_hostname.

    $ ping <robot_hostname>
    =ex. =
    $ ping 011304P0026

If unable to ping the robot visit this page.

Timeout observed when trying to enable the robot.

Assuming that you are able to $rostopic echo /rosout during Connecting-and-Testing-the-Development-Workstation#steps-for-connecting-to-baxter these prerequisite instructions. This error is a sign of the inability to make commands to the robot. This is due to your ROS_HOSTNAME/ROS_IP being set incorrectly.

View the ROS_ENVIRONMENT set for your current shell.

    $ env | grep ROS

Verify that either the ROS_HOSTNAME or ROS_IP is set for your development workstation.

If unsuccessful and the ROS_HOSTNAME is set, please unset this variable and use ROS_IP.

    $ unset ROS_HOSTNAME
    $ export ROS_IP=<your_development_workstation_ip>

Note: You can always view your current development workstation IP address using

    $ ifconfig

If unsuccessful and the ROS_IP is set, verify that this is describes your ip address and not the robot ip address.

    = Verify ROS_HOSTNAME is unset =
    $ unset ROS_HOSTNAME
    = Take note of your IP address =
    $ ifconfig
    = Export this as your ROS_IP =
    $ export ROS_IP=<your_development_workstation_ip>