Skip to content

Instantly share code, notes, and snippets.

@rethink-imcmahon
rethink-imcmahon / limb_tester.py
Last active August 29, 2015 14:18
Limb Tester for baxter_interface
#! /usr/bin/python
import rospy
import baxter_interface
rospy.init_node("foobar")
l = baxter_interface.Limb('left')
def limb_breaker(tid, l):
while not rospy.is_shutdown():
#!/usr/bin/env python
# Copyright (c) 2013-2015, Rethink Robotics
# All rights reserved.
# This script is meant to how the JTAS handles various numbers of points
# It executes a set of trajectories with 4 waypoints, then 3, then 2, then 1 waypoints. To run it:
# # one baxter.sh sourced terminal
# $ rosrun baxter_tools enable_robot.py -e
# $ rosrun baxter_interface joint_trajectory_action_server.py --mode velocity
@rethink-imcmahon
rethink-imcmahon / random_zero_error.py
Created April 14, 2015 15:35
Useful Time-based-random Zero error
Copyright (c) 2013-2015, Rethink Robotics
All rights reserved.
import time
if round(time.time() % 2):
foo = 10 / 0.0
<?xml version="1.0"?>
<robot name="physics">
<link name="base_link">
<visual>
<geometry>
<cylinder length="0.6" radius="0.2"/>
</geometry>
<material name="blue">
<color rgba="0 0 .8 1"/>
</material>
@rethink-imcmahon
rethink-imcmahon / joint_torque_delta.py
Last active August 29, 2015 14:24
Baxter's Left and Right Arm Torque readings
#! /usr/bin/python
import rospy
import baxter_interface
import numpy as np
rospy.init_node("torque_tester")
baxter_interface.robot_enable.RobotEnable().enable()
l = baxter_interface.Limb("left")
r = baxter_interface.Limb("right")
print "Moving the left arm to a neutral pose..."
@rethink-imcmahon
rethink-imcmahon / current_ik.py
Created July 20, 2015 19:25
Script for retrieving the IK solution of Baxter's current Joint Pose
#!/usr/bin/env python
# Copyright (c) 2013-2015, Rethink Robotics
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
@rethink-imcmahon
rethink-imcmahon / baxter_position_controller.cpp
Last active August 29, 2015 14:26
Example of JointGroupEffortController Subclassing
/*********************************************************************
* Software License Agreement (BSD License)
*
* Copyright (c) 2013-2015, Rethink Robotics
* Copyright (c) 2013, Open Source Robotics Foundation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@rethink-imcmahon
rethink-imcmahon / baxter_position_controller.h
Created July 31, 2015 15:28
Example of JointGroupEffortController Subclassing
/*********************************************************************
* Software License Agreement (BSD License)
*
* Copyright (c) 2013-2015, Rethink Robotics
* Copyright (c) 2013, Open Source Robotics Foundation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@rethink-imcmahon
rethink-imcmahon / listener_coredump.cpp
Last active August 29, 2015 14:28
A set of all threads backtraces in attempting to reproduce https://github.com/ros/ros_comm/issues/577
(gdb) thread apply all bt full
Thread 6 (Thread 0x7f34f4aaa700 (LWP 5480)):
#0 0x00007f34f939bda3 in select () at ../sysdeps/unix/syscall-template.S:81
No locals.
#1 0x00007f34f908d89a in XmlRpc::XmlRpcDispatch::work (this=0x156d0e8, timeout=-1)
at /data/users/imcmahon/dev/ros_core_ws/src/ros_comm/utilities/xmlrpcpp/src/XmlRpcDispatch.cpp:107
nEvents = 1
inFd = {fds_bits = {16, 0 <repeats 15 times>}}
outFd = {fds_bits = {0 <repeats 16 times>}}
@rethink-imcmahon
rethink-imcmahon / timer_callback_functioning.cpp
Created August 31, 2015 21:36
Properly Functioning Timer Callback Execution
PWD=/data/users/imcmahon/dev/ros_core_ws/devel/lib/roscpp_tutorials
---Type <return> to continue, or q <return> to quit---q
Quit
(gdb) b 55
Breakpoint 1 at 0x403aee: file /data/users/imcmahon/dev/ros_core_ws/src/ros_tutorials/roscpp_tutorials/timers/timers.cpp, line 55.
(gdb) run
Starting program: /data/users/imcmahon/dev/ros_core_ws/devel/lib/roscpp_tutorials/timers
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff1881700 (LWP 6059)]