SDK Shell

Created by Rico Stodt, Modified on Mon, 14 Feb, 2022 at 11:19 AM by Rico Stodt

This tutorial describes the configuration of the ROS environment on your developer workstation.


Contents


Overview


To communicate with and command your robot, we must establish the connection between your development PC and the robot. Assuming proper network setup, the SDK shell refers to the a configuration of your ROS environment which points your PC to the ROS Master, while registering your IP or Hostname allowing other processes to find you.


The SDK provides a convenient script, intera.sh , which helps foster the quickest and easiest ROS environment setup to get communicating with Sawyer. This script should have been installed/configured during Workstation Setup Tutorial, and the Hello Robot! Tutorial.


Quick Environment Setup via intera.sh


$ cd ~/ros_ws
$ ./intera.sh



Detailed Description/Setup


Intera.sh ROS Environment Setup


The intera.sh script is a convenient script allowing users to get their ROS environment setup quickly. It should allow for intuitive modification of the core components to get communicating with Sawyer setup quickly. It creates a heredoc which verifies all environment variables expected are provided, with a handy sim argument for local configurations (useful for simulation), and local argument (useful when SSH'd into Sawyer with no need to communicate to external, off-robot processes). This subshell created has the custom prompt modifications (with color) for quick visual checks as well.


Checkout Convenient intera.sh script


Copy the intera.sh file from intera_sdk repo to ros workspace.


Customize the intera.sh script


Please edit the intera.sh shell script making the necessary modifications to describe your development PC.

Using your favorite editor (gedit used for example)

 

$ cd ~/ros_ws
$ gedit intera.sh

 

Edit the ‘robot_hostname’ field

 

Please edit the 'robot_hostname' field:

# Specify robot's hostname

**robot_hostname="robot_hostname"**

Modifying where 'robot_hostname' is the [Robot_Hostname hostname of your robot]

  

Edit ‘your_ip’ or ‘your_hostname’ field

 

Please edit the 'your_ip' field (only if not using 'your_hostname'): 

 

**your_ip="192.168.XXX.XXX"**

 

Modifying where 'your_ip' is the IP address of your PC.

Useful command for identifying your IP address:

 

$ ifconfig
# Result will be contained in the 'inet addr' field (Ubuntu) or 'inet' field (Gentoo Robot PC).

 

Important: Only set either ROS_IP *OR* ROS_HOSTNAME.


Setting of both ROS_IP and ROS_HOSTNAME will result in ROS_HOSTNAME taking priority, resulting in confusing environment setups. Comment out the unused method using the '#' as leading character.

Alternatively, you may choose to use the hostname of your development PC.

Please edit the 'your_hostname' field (only if not using 'your_ip'):

 

***your_hostname="my_computer***

 

Modifying where 'your_hostname' is the hostname of your PC.

Important: This hostname must be resolvable to the robot. To test if your hostname is resolvable to Sawyer, please visit the development PC Networking page.

 

Edit ‘ros_version’ field


Please edit the 'ros_version' field:

***ros_version="indigo"***

Modifying where 'ros_version' is the your chosen ROS release.

  

Save and Close intera.sh script


Please save and close the intera.sh script.


Initialize your SDK environment


From this point forward, your ROS environment setup should be as simple as running the intera.sh script from the root of your Catkin workspace:


$ cd ~/ros_ws
$ ./intera.sh

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

 

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

 

This allows you to quickly view if your shell is configured for intera communication or not, and to which robot you are currently addressing (<robot_hostname>)


Verify SDK Shell


Test ability to ping robot

 

Ping what you have previously set as your robot_hostname.

 

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

 

The robot should always be enabled


Sawyer should always enabled, if the robot is not enabled, try to enabled the robot use the following command:

$ rosrun intera_interface enable_robot.py -e

If unsuccessful in enabling the robot, please follow the instructions below. This is typically due to a ROS_HOSTNAME being set which is not resolvable to Sawyer. Please unset your ROS_HOSTNAME, instead using your ROS_IP. Make sure this is reflected permanently in your intera.sh script.


Timeout observed when trying to enable the robot


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 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>

 

 

 

 


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article