博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Baxter机器人---Hello_baster(二)
阅读量:6844 次
发布时间:2019-06-26

本文共 5354 字,大约阅读时间需要 17 分钟。

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

 

Step 1: Setup ROS Environment

root@zxwubuntu-Aspire-V3-572G:~#  cd ~/ros_wsroot@zxwubuntu-Aspire-V3-572G:~# source /opt/ros/indigo/setup.bashroot@zxwubuntu-Aspire-V3-572G:~# catkin_make

 Source ROS Environment Setup Script

# Source baxter.sh scriptroot@zxwubuntu-Aspire-V3-572G:~# . baxter.sh 

 Step 2: Verify ROS Connectivity

1.Verify ROS Master Ping

# Identify the ROS Master locationroot@zxwubuntu-Aspire-V3-572G:~# env | grep ROS_MASTER_URIroot@zxwubuntu-Aspire-V3-572G:~# ping 
# Exampleroot@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_IPROS_IP=192.168.1.102
$ ssh ruser@
# 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 PCruser@p99 ~ $ ping
# Examples:# ROS_IPruser@p99 ~ $ ping 192.168.101.99# ROS_HOSTNAMEruser@p99 ~ $ ping yodaruser@p99 ~ $ exit

 4.Echo a ROS Topic

root@zxwubuntu-Aspire-V3-572G:~# cd ~/ros_wsroot@zxwubuntu-Aspire-V3-572G:~# . baxter.shroot@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.rosinstallRelease v1.2.0 	https://raw.githubusercontent.com/RethinkRobotics/baxter/release-1.2.0/baxter_sdk.rosinstallRelease v1.1.1 	https://raw.githubusercontent.com/RethinkRobotics/baxter/release-1.1.1/baxter_sdk.rosinstallRelease v1.1.0 	https://raw.githubusercontent.com/RethinkRobotics/baxter/release-1.1.0/baxter_sdk.rosinstallRelease v1.0.0 	https://github.com/RethinkRobotics/baxter/raw/ea58ecd3204368791bf8d0afe5e9c7d0354b6e58/baxter_sdk.rosinstallRelease 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 updateroot@zxwubuntu-Aspire-V3-572G:~# cd ~/ros_ws/srcroot@zxwubuntu-Aspire-V3-572G:~# cd baxter/root@zxwubuntu-Aspire-V3-572G:~# git describe  v1.1.1root@zxwubuntu-Aspire-V3-572G:~# cd ~/ros_wsroot@zxwubuntu-Aspire-V3-572G:~# ./baxter.shroot@zxwubuntu-Aspire-V3-572G:~# catkin_makeroot@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()

 

你可能感兴趣的文章
《初级会计电算化应用教程(金蝶KIS专业版)》——1.3 电算化会计信息系统
查看>>
Android 开发者应该使用 FlatBuffers 替代 JSON ?
查看>>
《拥抱变化——社交网络时代的企业转型之道》一找准组织目标和企业文化
查看>>
《Arduino奇妙之旅:智能车趣味制作天龙八步》一3.2 构建小发明
查看>>
《Cisco安全防火墙服务模块(FWSM)解决方案》——第2章防火墙服务模块概述
查看>>
Go语言项目(kingshard)性能优化实例剖析
查看>>
安全预警:ImageMagick 图象处理软件存在远程代码执行(CVE-2016-3714)
查看>>
Google 为什么要把最重要的秘密开源?
查看>>
《Hadoop大数据分析与挖掘实战》——1.5节餐饮服务中的大数据应用
查看>>
《ANSYS Workbench 14有限元分析自学手册》——2.5 体操作
查看>>
《交互式程序设计 第2版》一第1章 交互设计导论
查看>>
ARM拟将ARM核心置入未来的Fusion APU中
查看>>
3分钟参与阿里云《金融行业云上信任报告》调查问卷,98%的几率拿到代金券
查看>>
《C语言编程魔法书:基于C11标准》——2.9 本章小结
查看>>
《移动数据挖掘》—— 1.4 本书简介
查看>>
菲尔兹奖得主维拉尼:七个点子帮你找到科研灵感
查看>>
《C语言程序设计与实践(第2版)》——导读
查看>>
《Java EE 7精粹》—— 第2章 Servlets 2.1 WebServlet
查看>>
《计算机科学概论(第12版)》—第1章1.4节用位模式表示信息
查看>>
C2B前还有S2b,阿里携手产学研探索新零售时代的供应链未来
查看>>