Skip to content

Instantly share code, notes, and snippets.

@falcondai
Created June 28, 2016 22:09
Show Gist options
  • Save falcondai/e829cfaba7c77b165a1886e50a101339 to your computer and use it in GitHub Desktop.
Save falcondai/e829cfaba7c77b165a1886e50a101339 to your computer and use it in GitHub Desktop.
using baxter custom APIs to control a limb
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import rospy\n",
"import baxter_interface"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"rospy.init_node('custom_limb')"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"limb = baxter_interface.Limb('left')"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"{'left_e0': 3.056840215058658,\n",
" 'left_e1': 0.8149272935641261,\n",
" 'left_s0': -0.4195437454866607,\n",
" 'left_s1': -0.5518495884417776,\n",
" 'left_w0': -0.3416942205014759,\n",
" 'left_w1': 1.135912773429149,\n",
" 'left_w2': -0.0011504855909140602}"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"limb.joint_angles()"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"limb.move_to_joint_positions({'left_e0': 0.})"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment