1. ros安装
ros的安装方法参考创客智造,注意安装ubuntu系统对应版本的ros,新版ros-melodic可以在windows中使用,没用过,不推荐。
2. sawyer sdk安装
sawyer的sdk安装方法可参考我的码云,里面有sawyer研究版的用户指南,因为sawyer没有类似UR5的示教器,所以用pyQt简单的写了个sawyer的GUI控制界面,功能还不够完善,后面会一直更新。
通过以下方法获取sdk:
$ cd ~/ros_ws/src
$ wstool init .
$ git clone https://github.com/RethinkRobotics/sawyer_robot.git
$ wstool merge sawyer_robot/sawyer_robot.rosinstall
$ wstool update
$ source /opt/ros/indigo/setup.bash
$ cd ~/ros_ws
$ catkin_make
注意这里的ros_ws是ros工作空间的名称,需替换为你自己电脑的工作空间名
3. sawyer sdk环境配置
$ cp ~/ros_ws/src/intera_sdk/intera.sh ~/ros_ws
$ cd ~/ros_ws
$ gedit intera.sh
- 修改intera.sh中的robot_hostname, your_ip, ros_version, 修改后如下:
#-----------------------------------------------------------------------------#
# USER CONFIGURABLE ROS ENVIRONMENT VARIABLES #
#-----------------------------------------------------------------------------#
# Note: If ROS_MASTER_URI, ROS_IP, or ROS_HOSTNAME environment variables were
# previously set (typically in your .bashrc or .bash_profile), those settings
# will be overwritten by any variables set here.
# Specify Robot's hostname
robot_hostname="021608CP00051.local"
# Set *Either* your computers ip address or hostname. Please note if using
# your_hostname that this must be resolvable to the Robot.
your_ip="192.168.1.100"
#your_hostname="my_computer.local"
# Specify ROS distribution (e.g. indigo, hydro, etc.)
ros_version="melodic"
其中,robot_hostname在这篇博客中提到,your_ip为你电脑的IP(电脑和sawyer必须在同一局域网内),ros_version为你安装的ros版本名。
4. 测试
$ cd ~/ros_ws
$ ./intera.sh
- ping测试,ping sawyer机械臂的host_name:
$ ping 021605CP00006.local
$ rostopic echo /robot/joint_states
- 更多例程,参考~/ros_ws/src/intera_sdk/intera_examples/scripts文件夹下的py文件。