Baxter机器人---Hello_baster(二)
原创博文,转载请标明出处:--周学伟http://www.cnblogs.com/zxouxuewei/
Step 1: Setup ROS Environment
root@zxwubuntu-Aspire-V3-572G:~# cd ~/ros_ws
root@zxwubuntu-Aspire-V3-572G:~# source /opt/ros/indigo/setup.bash
root@zxwubuntu-Aspire-V3-572G:~# catkin_make
Source ROS Environment Setup Script
# Source baxter.sh script
root@zxwubuntu-Aspire-V3-572G:~# . baxter.sh
Step 2: Verify ROS Connectivity
1.Verify ROS Master Ping
# Identify the ROS Master location
root@zxwubuntu-Aspire-V3-572G:~# env | grep ROS_MASTER_URI
root@zxwubuntu-Aspire-V3-572G:~# ping <our ROS Master>
# Example
root@zxwubuntu-Aspire-V3-572G:~# ping 011503P0019.local
2.View Available ROS Topics
root@zxwubuntu-Aspire-V3-572G:~# rostopic list
/robustcontroller/Tare/JointPoseAction/right/set_dc_weights
/robustcontroller/Tare/JointPoseAction/right/set_ff_weights
/robustcontroller/left/CalibrateArm/enable
/robustcontroller/left/CalibrateArm/status
/robustcontroller/left/Tare/enable
/robustcontroller/left/Tare/status
/robustcontroller/right/CalibrateArm/enable
/robustcontroller/right/CalibrateArm/status
/robustcontroller/right/Tare/enable
/robustcontroller/right/Tare/status
.........
3.Verify Development Workstation Ping
$ env | grep ROS_IP
ROS_IP=192.168.1.102
$ ssh ruser@<our ROS Master> # Password: rethink # Example:
$ ssh ruser@011303P0017.local # Now that we have SSH'd into the robot, verify that we are able to ping back to the development PC
ruser@p99 ~ $ ping <ROS_IP/ROS_HOSTNAME> # Examples:
# ROS_IP
ruser@p99 ~ $ ping 192.168.101.99
# ROS_HOSTNAME
ruser@p99 ~ $ ping yoda
ruser@p99 ~ $ exit
4.Echo a ROS Topic
root@zxwubuntu-Aspire-V3-572G:~# cd ~/ros_ws
root@zxwubuntu-Aspire-V3-572G:~# . baxter.sh
root@zxwubuntu-Aspire-V3-572G:~# rostopic echo /robot/joint_states
--->>
Step 3: Enable the Robot
root@zxwubuntu-Aspire-V3-572G:~# rosrun baxter_tools enable_robot.py -e
此处由于,baxter广方提供的SDK包和baxter robot的软件版本不对应会出问题:
后来参考:http://sdk.rethinkrobotics.com/wiki/Workstation_Update 后解决。
root@zxwubuntu-Aspire-V3-572G:~# cd ~/ros_ws/src/
root@zxwubuntu-Aspire-V3-572G:~# gedit baxter_sdk.rosinstall &
Master https://github.com/RethinkRobotics/baxter/raw/master/baxter_sdk.rosinstall
Release v1.2.0 https://raw.githubusercontent.com/RethinkRobotics/baxter/release-1.2.0/baxter_sdk.rosinstall
Release v1.1.1 https://raw.githubusercontent.com/RethinkRobotics/baxter/release-1.1.1/baxter_sdk.rosinstall
Release v1.1.0 https://raw.githubusercontent.com/RethinkRobotics/baxter/release-1.1.0/baxter_sdk.rosinstall
Release v1.0.0 https://github.com/RethinkRobotics/baxter/raw/ea58ecd3204368791bf8d0afe5e9c7d0354b6e58/baxter_sdk.rosinstall
Release v0.7.0 https://github.com/RethinkRobotics/baxter/raw/ff8afbd2d0dd71b6f5d3acc14a210313e1b6fcb7/baxter_sdk.rosinstall
- git:
local-name: baxter
uri: https://github.com/RethinkRobotics/baxter.git
version: master
- git:
local-name: baxter_interface
uri: https://github.com/RethinkRobotics/baxter_interface.git
version: master
- git:
local-name: baxter_tools
uri: https://github.com/RethinkRobotics/baxter_tools.git
version: master
- git:
local-name: baxter_common
uri: https://github.com/RethinkRobotics/baxter_common.git
version: master
- git:
local-name: baxter_examples
uri: https://github.com/RethinkRobotics/baxter_examples.git
version: master 保存退出:
root@zxwubuntu-Aspire-V3-572G:~# wstool update
root@zxwubuntu-Aspire-V3-572G:~# cd ~/ros_ws/src
root@zxwubuntu-Aspire-V3-572G:~# cd baxter/
root@zxwubuntu-Aspire-V3-572G:~# git describe
v1.1.1
root@zxwubuntu-Aspire-V3-572G:~# cd ~/ros_ws
root@zxwubuntu-Aspire-V3-572G:~# ./baxter.sh
root@zxwubuntu-Aspire-V3-572G:~# catkin_make
root@zxwubuntu-Aspire-V3-572G:~# catkin_make install
重新使能机器人
root@zxwubuntu-Aspire-V3-572G:~# rosrun baxter_tools enable_robot.py -e
Step 4: Run an Example Program
root@zxwubuntu-Aspire-V3-572G:~# rosrun baxter_examples joint_velocity_wobbler.py
Step 5: Interactively Program Baxter
root@zxwubuntu-Aspire-V3-572G:~# rosrun baxter_tools enable_robot.py -e
$ python # Import the necessary Python modules # rospy - ROS Python API
>>> import rospy # baxter_interface - Baxter Python API
>>> import baxter_interface # initialize our ROS node, registering it with the Master
>>> rospy.init_node('Hello_Baxter') # create an instance of baxter_interface's Limb class
>>> limb = baxter_interface.Limb('right') # get the right limb's current joint angles
>>> angles = limb.joint_angles() # print the current joint angles
>>> print angles # reassign new joint angles (all zeros) which we will later command to the limb
>>> angles['right_s0']=0.0
>>> angles['right_s1']=0.0
>>> angles['right_e0']=0.0
>>> angles['right_e1']=0.0
>>> angles['right_w0']=0.0
>>> angles['right_w1']=0.0
>>> angles['right_w2']=0.0 # print the joint angle command
>>> print angles # move the right arm to those joint angles
>>> limb.move_to_joint_positions(angles) # Baxter wants to say hello, let's wave the arm # store the first wave position
>>> 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} # store the second wave position
>>> 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} # wave three times
>>> for _move in range(3):
... limb.move_to_joint_positions(wave_1)
... limb.move_to_joint_positions(wave_2) # quit
>>> quit()
Baxter机器人---Hello_baster(二)的更多相关文章
- Baxter机器人---安装SDK包(二)
原创博文,转载请标明出处:--周学伟http://www.cnblogs.com/zxouxuewei/ 一.frist baxter robot workspace root@zxwubuntu-A ...
- Baxter机器人---测试准备(一)
原创博文,转载请标明出处:--周学伟http://www.cnblogs.com/zxouxuewei/ baxter:http://sdk.rethinkrobotics.com/wiki/Work ...
- ROS中的3D机器人建模(二)
一,创建我们的第一个URDF模型 我们设计的第一个机器人模型是pan-and-tilt机械结构,代码如下 pan_tilt.urdf: 1 <?xml version="1.0&quo ...
- 用 AIML 开发人工智能聊天机器人
借助 Python 的 AIML 包,我们很容易实现人工智能聊天机器人.AIML 指的是 Artificial Intelligence Markup Language (人工智能标记语言),它不过是 ...
- ROS探索总结(十九)——怎样配置机器人的导航功能
1.概述 ROS的二维导航功能包.简单来说.就是依据输入的里程计等传感器的信息流和机器人的全局位置,通过导航算法,计算得出安全可靠的机器人速度控制指令. 可是,怎样在特定的机器人上实现导航功能包的功能 ...
- Zabbix钉钉小机器人报警
1.下载钉钉所需要的脚本golang-zabbix-robot-64,浏览器访问https://www.appgao.com/files/192.html: 图一 脚本下载 2.将脚本路径添加到 ...
- Java练习 SDUT-2585_机器人II
机器人II Time Limit: 1000 ms Memory Limit: 65536 KiB Problem Description 自从xiao_wu发明了只能向左转与向右转的机器人以后,热血 ...
- 第15.39节、splitDockWidget和tabifyDockWidget嵌套布局QDockWidget的PyQt人机对话案例:笨笨机器人
专栏:Python基础教程目录 专栏:使用PyQt开发图形界面Python应用 专栏:PyQt入门学习 老猿Python博文目录 一.引言 在第<第三十一章.containers容器类部件QDo ...
- 第三十二章、使用splitDockWidget和tabifyDockWidget嵌套布局QDockWidget的PyQt人机对话案例
专栏:Python基础教程目录 专栏:使用PyQt开发图形界面Python应用 专栏:PyQt入门学习 老猿Python博文目录 一.引言 在第<第三十一章.containers容器类部件QDo ...
随机推荐
- shell指令expr和test指令
通过expr指令可以进行+.-.*.\.%等运算,但是有一点值得注意,使用乘法时,要在*前加上一个\符号. 通过test指令可以进行逻辑测试,进行测试的情况有四种: 1.整数测试 a.判断两个整数是否 ...
- [安卓]softap
http://www.cnblogs.com/javawebsoa/archive/2013/05/29/3106758.html
- ImageLoder配置以及使用(个人阅读使用)
http://blog.csdn.net/vipzjyno1/article/details/23206387 在gradle添加: compile 'com.nostra13.universalim ...
- 关于wait和notify的用法
通常,多线程之间需要协调工作.例如,浏览器的一个显示图片的线程displayThread想要执行显示图片的任务,必须等待下载线程 downloadThread将该图片下载完毕.如果图片还没有下载完,d ...
- UVa 10328 - Coin Toss (递推)
题意:给你一个硬币,抛掷n次,问出现连续至少k个正面向上的情况有多少种. 原题中问出现连续至少k个H的情况,很难下手.我们可以试着将问题转化一下. 设dp[i][j]表示抛掷i个硬币出现连续至多j个H ...
- iOS弹框
IOS 弹框 如果直接弹出一个自定义的视图 可以选用第三方: MJPopup 弹出: if(!bandview) { bandview=[[[NSBundle mainBundle]loadNibNa ...
- c#多线程(UI线程,控件显示更新) Invoke和BeginInvoke 区别
如果只是直接使用子线程访问UI控件,直接看内容三,如果想深入了解从内容一看起. 一.Control.Invoke和BeginInvoke方法的区别 先上总结: Control.Invoke 方法 (D ...
- 极客DIY:打造属于自己的无线移动渗透测试箱
本文中介绍的工具.技术带有一定的攻击性,请合理合法使用. 你想不想拥有一款属于自己的移动无线渗透测试箱,如果你感兴趣,下面介绍的设备将会对你很有帮助.这个箱子被称为“MiTM(中间人攻击)WiFi箱” ...
- 基于HTML5+CSS3的图片旋转、无限滚动、文字跳动特效
本文分享几种基于HTML5+CSS3实现的一些动画特效:图片旋转.无限滚动.文字跳动;实现起来均比较容易,动手来试试! 一.图片旋转 效果图如下: 这个效果实现起来其实并不困难.代码清单如下: < ...
- 黑马程序员——【Java基础】——多线程
---------- android培训.java培训.期待与您交流! ---------- 一.概述 (一)进程 正在执行中的程序,每一个进程执行都有一个执行顺序.该顺序是一个执行路径,或者叫一个控 ...