原创博文,转载请标明出处:--周学伟http://www.cnblogs.com/zxouxuewei/

Step 1: Setup ROS Environment

  1. root@zxwubuntu-Aspire-V3-572G:~# cd ~/ros_ws
  2. root@zxwubuntu-Aspire-V3-572G:~# source /opt/ros/indigo/setup.bash
  3. root@zxwubuntu-Aspire-V3-572G:~# catkin_make

Source ROS Environment Setup Script

  1. # Source baxter.sh script
  2. root@zxwubuntu-Aspire-V3-572G:~# . baxter.sh
  3.  

 Step 2: Verify ROS Connectivity

1.Verify ROS Master Ping

  1. # Identify the ROS Master location
  2. root@zxwubuntu-Aspire-V3-572G:~# env | grep ROS_MASTER_URI
  3. root@zxwubuntu-Aspire-V3-572G:~# ping <our ROS Master>
  4. # Example
  5. root@zxwubuntu-Aspire-V3-572G:~# ping 011503P0019.local

2.View Available ROS Topics

  1. root@zxwubuntu-Aspire-V3-572G:~# rostopic list
  1. /robustcontroller/Tare/JointPoseAction/right/set_dc_weights
  2. /robustcontroller/Tare/JointPoseAction/right/set_ff_weights
  3. /robustcontroller/left/CalibrateArm/enable
  4. /robustcontroller/left/CalibrateArm/status
  5. /robustcontroller/left/Tare/enable
  6. /robustcontroller/left/Tare/status
  7. /robustcontroller/right/CalibrateArm/enable
  8. /robustcontroller/right/CalibrateArm/status
  9. /robustcontroller/right/Tare/enable
  10. /robustcontroller/right/Tare/status
    .........

3.Verify Development Workstation Ping

  1. $ env | grep ROS_IP
  2. ROS_IP=192.168.1.102
  1. $ ssh ruser@<our ROS Master>
  2.  
  3. # Password: rethink
  4.  
  5. # Example:
  6. $ ssh ruser@011303P0017.local
  7.  
  8. # Now that we have SSH'd into the robot, verify that we are able to ping back to the development PC
  9. ruser@p99 ~ $ ping <ROS_IP/ROS_HOSTNAME>
  10.  
  11. # Examples:
  12. # ROS_IP
  13. ruser@p99 ~ $ ping 192.168.101.99
  14. # ROS_HOSTNAME
  15. ruser@p99 ~ $ ping yoda
  16. ruser@p99 ~ $ exit

4.Echo a ROS Topic

  1. root@zxwubuntu-Aspire-V3-572G:~# cd ~/ros_ws
  2. root@zxwubuntu-Aspire-V3-572G:~# . baxter.sh
  3. root@zxwubuntu-Aspire-V3-572G:~# rostopic echo /robot/joint_states

--->>

 Step 3: Enable the Robot

  1. root@zxwubuntu-Aspire-V3-572G:~# rosrun baxter_tools enable_robot.py -e

此处由于,baxter广方提供的SDK包和baxter robot的软件版本不对应会出问题:

后来参考:http://sdk.rethinkrobotics.com/wiki/Workstation_Update  后解决。

  1. root@zxwubuntu-Aspire-V3-572G:~# cd ~/ros_ws/src/
  2. root@zxwubuntu-Aspire-V3-572G:~# gedit baxter_sdk.rosinstall &
  1. Master https://github.com/RethinkRobotics/baxter/raw/master/baxter_sdk.rosinstall
  2. Release v1.2.0 https://raw.githubusercontent.com/RethinkRobotics/baxter/release-1.2.0/baxter_sdk.rosinstall
  3. Release v1.1.1 https://raw.githubusercontent.com/RethinkRobotics/baxter/release-1.1.1/baxter_sdk.rosinstall
  4. Release v1.1.0 https://raw.githubusercontent.com/RethinkRobotics/baxter/release-1.1.0/baxter_sdk.rosinstall
  5. Release v1.0.0 https://github.com/RethinkRobotics/baxter/raw/ea58ecd3204368791bf8d0afe5e9c7d0354b6e58/baxter_sdk.rosinstall
  6. Release v0.7.0 https://github.com/RethinkRobotics/baxter/raw/ff8afbd2d0dd71b6f5d3acc14a210313e1b6fcb7/baxter_sdk.rosinstall
  1. - git:
  2. local-name: baxter
  3. uri: https://github.com/RethinkRobotics/baxter.git
  4. version: master
  5. - git:
  6. local-name: baxter_interface
  7. uri: https://github.com/RethinkRobotics/baxter_interface.git
  8. version: master
  9. - git:
  10. local-name: baxter_tools
  11. uri: https://github.com/RethinkRobotics/baxter_tools.git
  12. version: master
  13. - git:
  14. local-name: baxter_common
  15. uri: https://github.com/RethinkRobotics/baxter_common.git
  16. version: master
  17. - git:
  18. local-name: baxter_examples
  19. uri: https://github.com/RethinkRobotics/baxter_examples.git
  20. version: master
  21.  
  22. 保存退出:
  1. root@zxwubuntu-Aspire-V3-572G:~# wstool update
  2. root@zxwubuntu-Aspire-V3-572G:~# cd ~/ros_ws/src
  3. root@zxwubuntu-Aspire-V3-572G:~# cd baxter/
  4. root@zxwubuntu-Aspire-V3-572G:~# git describe
  5.   v1.1.1
  6. root@zxwubuntu-Aspire-V3-572G:~# cd ~/ros_ws
  7. root@zxwubuntu-Aspire-V3-572G:~# ./baxter.sh
  8. root@zxwubuntu-Aspire-V3-572G:~# catkin_make
  9. root@zxwubuntu-Aspire-V3-572G:~# catkin_make install

重新使能机器人

  1. root@zxwubuntu-Aspire-V3-572G:~# rosrun baxter_tools enable_robot.py -e

 Step 4: Run an Example Program

  1. root@zxwubuntu-Aspire-V3-572G:~# rosrun baxter_examples joint_velocity_wobbler.py

 Step 5: Interactively Program Baxter

  1. root@zxwubuntu-Aspire-V3-572G:~# rosrun baxter_tools enable_robot.py -e
  1. $ python
  2.  
  3. # Import the necessary Python modules
  4.  
  5. # rospy - ROS Python API
  6. >>> import rospy
  7.  
  8. # baxter_interface - Baxter Python API
  9. >>> import baxter_interface
  10.  
  11. # initialize our ROS node, registering it with the Master
  12. >>> rospy.init_node('Hello_Baxter')
  13.  
  14. # create an instance of baxter_interface's Limb class
  15. >>> limb = baxter_interface.Limb('right')
  16.  
  17. # get the right limb's current joint angles
  18. >>> angles = limb.joint_angles()
  19.  
  20. # print the current joint angles
  21. >>> print angles
  22.  
  23. # reassign new joint angles (all zeros) which we will later command to the limb
  24. >>> angles['right_s0']=0.0
  25. >>> angles['right_s1']=0.0
  26. >>> angles['right_e0']=0.0
  27. >>> angles['right_e1']=0.0
  28. >>> angles['right_w0']=0.0
  29. >>> angles['right_w1']=0.0
  30. >>> angles['right_w2']=0.0
  31.  
  32. # print the joint angle command
  33. >>> print angles
  34.  
  35. # move the right arm to those joint angles
  36. >>> limb.move_to_joint_positions(angles)
  37.  
  38. # Baxter wants to say hello, let's wave the arm
  39.  
  40. # store the first wave position
  41. >>> wave_1 = {'right_s0': -0.459, 'right_s1': -0.202, 'right_e0': 1.807, 'right_e1': 1.714, 'right_w0': -0.906, 'right_w1': -1.545, 'right_w2': -0.276}
  42.  
  43. # store the second wave position
  44. >>> wave_2 = {'right_s0': -0.395, 'right_s1': -0.202, 'right_e0': 1.831, 'right_e1': 1.981, 'right_w0': -1.979, 'right_w1': -1.100, 'right_w2': -0.448}
  45.  
  46. # wave three times
  47. >>> for _move in range(3):
  48. ... limb.move_to_joint_positions(wave_1)
  49. ... limb.move_to_joint_positions(wave_2)
  50.  
  51. # quit
  52. >>> quit()

Baxter机器人---Hello_baster(二)的更多相关文章

  1. Baxter机器人---安装SDK包(二)

    原创博文,转载请标明出处:--周学伟http://www.cnblogs.com/zxouxuewei/ 一.frist baxter robot workspace root@zxwubuntu-A ...

  2. Baxter机器人---测试准备(一)

    原创博文,转载请标明出处:--周学伟http://www.cnblogs.com/zxouxuewei/ baxter:http://sdk.rethinkrobotics.com/wiki/Work ...

  3. ROS中的3D机器人建模(二)

    一,创建我们的第一个URDF模型 我们设计的第一个机器人模型是pan-and-tilt机械结构,代码如下 pan_tilt.urdf: 1 <?xml version="1.0&quo ...

  4. 用 AIML 开发人工智能聊天机器人

    借助 Python 的 AIML 包,我们很容易实现人工智能聊天机器人.AIML 指的是 Artificial Intelligence Markup Language (人工智能标记语言),它不过是 ...

  5. ROS探索总结(十九)——怎样配置机器人的导航功能

    1.概述 ROS的二维导航功能包.简单来说.就是依据输入的里程计等传感器的信息流和机器人的全局位置,通过导航算法,计算得出安全可靠的机器人速度控制指令. 可是,怎样在特定的机器人上实现导航功能包的功能 ...

  6. Zabbix钉钉小机器人报警

    1.下载钉钉所需要的脚本golang-zabbix-robot-64,浏览器访问https://www.appgao.com/files/192.html: 图一    脚本下载 2.将脚本路径添加到 ...

  7. Java练习 SDUT-2585_机器人II

    机器人II Time Limit: 1000 ms Memory Limit: 65536 KiB Problem Description 自从xiao_wu发明了只能向左转与向右转的机器人以后,热血 ...

  8. 第15.39节、splitDockWidget和tabifyDockWidget嵌套布局QDockWidget的PyQt人机对话案例:笨笨机器人

    专栏:Python基础教程目录 专栏:使用PyQt开发图形界面Python应用 专栏:PyQt入门学习 老猿Python博文目录 一.引言 在第<第三十一章.containers容器类部件QDo ...

  9. 第三十二章、使用splitDockWidget和tabifyDockWidget嵌套布局QDockWidget的PyQt人机对话案例

    专栏:Python基础教程目录 专栏:使用PyQt开发图形界面Python应用 专栏:PyQt入门学习 老猿Python博文目录 一.引言 在第<第三十一章.containers容器类部件QDo ...

随机推荐

  1. inoic是什么

    本篇只侧重框架提供的功能和能力的研究,请关注后续实际部署使用体验. 一.inoic是什么? inoic是一个可以使用Web技术以hybird方式开发移动app的前端开源框架. 二.inoic框架特点 ...

  2. [开发笔记]-“在引用COM组件时,出现了无法嵌入互操作类型。。。”的错误

    这两天在做一个需要将wps文档转换成word文档的程序,在调用wps的com组件时项目编译是没有问题的,但当运行的时候却弹出了下面的错误提示: 从网上百度一番后,找到了正确的解决方法. 先从Com组件 ...

  3. [安卓]我的安卓开发FAQ

    1.什么是ADT: android官方解释是:ADT (Android Developer Tools) is a plugin for Eclipse that provides a suite o ...

  4. xampp笔记

    1.XAMPP添加VirtualHost以支持多个站点 服务器有1个ip,但多个网站通过dns都可以指到这台服务器上,这时候要配置虚拟主机(单一系统上运行多个网站) 用顶级域名 访问方式 来访问你本地 ...

  5. SQL中让某一字段更新时自动加1

    update 表 set 字段名=字段名+1 where ....

  6. Linux Mint下安装JDK

    Linux Mint 17下安装的是默认的OpenJDK,可以使用java -version查看 现在需要使用Sun/Oracle官方的JDK:http://www.oracle.com/techne ...

  7. BZOJ 1853 幸运数字

    需要优化一波常数. 以及刚才那个版本是错的. #include<iostream> #include<cstdio> #include<cstring> #incl ...

  8. __set()与__get() 魔术方法

    在面向对象编程的过程中,对于类当中的各个成员变量,都有不同的访问属性,比如公有的(public)属性,在类内部和类外部都可直接调用:而私有的(private)和受保护的(protected),在类外不 ...

  9. Git使用详细教程

    参考网址: http://www.admin10000.com/document/5374.html http://blog.sina.com.cn/s/blog_4f3b79d0010166ab.h ...

  10. Mac OS环境变量配置(Android Studio之Gradle)

    以gradle环境变量配置为例: Android Studio 自带的gradle路径为: /Applications/Android\ Studio.app/Contents/gradle/grad ...