|
From: <stu...@us...> - 2008-10-17 22:49:29
|
Revision: 5519
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=5519&view=rev
Author: stuglaser
Date: 2008-10-17 22:49:22 +0000 (Fri, 17 Oct 2008)
Log Message:
-----------
Cleaner calibration for the prototype
Modified Paths:
--------------
pkg/trunk/mechanism/mechanism_bringup/scripts/calibrate.py
pkg/trunk/robot_descriptions/wg_robot_description/pr2_robot_defs/cal_arm.xml
Added Paths:
-----------
pkg/trunk/robot_descriptions/wg_robot_description/pr2_prototype1/calibrate.launch
pkg/trunk/robot_descriptions/wg_robot_description/pr2_robot_defs/cal_base.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2_robot_defs/cal_head.xml
pkg/trunk/robot_descriptions/wg_robot_description/pr2_robot_defs/cal_torso.xml
Modified: pkg/trunk/mechanism/mechanism_bringup/scripts/calibrate.py
===================================================================
--- pkg/trunk/mechanism/mechanism_bringup/scripts/calibrate.py 2008-10-17 22:40:25 UTC (rev 5518)
+++ pkg/trunk/mechanism/mechanism_bringup/scripts/calibrate.py 2008-10-17 22:49:22 UTC (rev 5519)
@@ -37,7 +37,7 @@
import rostools
import copy
import threading
-import sys
+import sys, os
from time import sleep
# Loads interface with the robot.
@@ -95,7 +95,8 @@
xml = ''
if len(sys.argv) > 1:
- xmls = [slurp(filename) for filename in sys.argv[1:]]
+ #xmls = [slurp(filename) for filename in sys.argv[1:]]
+ xmls = [os.popen2("rosrun xacro xacro.py %s" % f)[1].read() for f in sys.argv[1:]]
# Poor man's xml splicer
for i in range(len(xmls) - 1):
Added: pkg/trunk/robot_descriptions/wg_robot_description/pr2_prototype1/calibrate.launch
===================================================================
--- pkg/trunk/robot_descriptions/wg_robot_description/pr2_prototype1/calibrate.launch (rev 0)
+++ pkg/trunk/robot_descriptions/wg_robot_description/pr2_prototype1/calibrate.launch 2008-10-17 22:49:22 UTC (rev 5519)
@@ -0,0 +1,7 @@
+<launch>
+ <node pkg="mechanism_bringup" type="calibrate.py"
+ args="$(find wg_robot_description)/pr2_robot_defs/cal_tilt_laser.xml
+ $(find wg_robot_description)/pr2_robot_defs/cal_base.xml
+ $(find wg_robot_description)/pr2_robot_defs/cal_head.xml
+ $(find wg_robot_description)/pr2_robot_defs/cal_torso.xml" />
+</launch>
Modified: pkg/trunk/robot_descriptions/wg_robot_description/pr2_robot_defs/cal_arm.xml
===================================================================
--- pkg/trunk/robot_descriptions/wg_robot_description/pr2_robot_defs/cal_arm.xml 2008-10-17 22:40:25 UTC (rev 5518)
+++ pkg/trunk/robot_descriptions/wg_robot_description/pr2_robot_defs/cal_arm.xml 2008-10-17 22:49:22 UTC (rev 5519)
@@ -1,17 +1,28 @@
<controllers>
- <controller name="cal_shoulder_pan" topic="cal_shoulder_pan" type="JointCalibrationControllerNode">
- <calibrate joint="shoulder_pan_right_joint"
- actuator="shoulder_pan_right_motor"
- transmission="shoulder_pan_right_trans"
- velocity="0.6" />
- <pid p="7" i="0.5" d="0" iClamp="1.0" />
- </controller>
- <controller name="cal_shoulder_pitch" topic="cal_shoulder_pitch" type="JointCalibrationControllerNode">
- <calibrate joint="shoulder_pitch_right_joint"
- actuator="shoulder_pitch_right_motor"
- transmission="shoulder_pitch_right_trans"
- velocity="0.6" />
- <pid p="7" i="0.5" d="0" iClamp="1.0" />
- </controller>
+ <macro name="shoulder_pan_calibrator" params="suffix">
+ <controller name="cal_shoulder_pan_${suffix}" topic="cal_shoulder_pan_${suffix}"
+ type="JointCalibrationControllerNode">
+ <calibrate joint="shoulder_pan_${suffix}_joint"
+ actuator="shoulder_pan_${suffix}_motor"
+ transmission="shoulder_pan_${suffix}_trans"
+ velocity="0.6" />
+ <pid p="7" i="0.5" d="0" iClamp="1.0" />
+ </controller>
+ </macro>
+
+ <macro name="shoulder_pitch_calibrator" params="suffix">
+ <controller name="cal_shoulder_pitch_${suffix}" topic="cal_shoulder_pitch_${suffix}"
+ type="JointCalibrationControllerNode">
+ <calibrate joint="shoulder_pitch_${suffix}_joint"
+ actuator="shoulder_pitch_${suffix}_motor"
+ transmission="shoulder_pitch_${suffix}_trans"
+ velocity="0.6" />
+ <pid p="7" i="0.5" d="0" iClamp="1.0" />
+ </controller>
+ </macro>
+
+ <shoulder_pan_calibrator suffix="right" />
+ <shoulder_pitch_calibrator suffix="right" />
+
</controllers>
Added: pkg/trunk/robot_descriptions/wg_robot_description/pr2_robot_defs/cal_base.xml
===================================================================
--- pkg/trunk/robot_descriptions/wg_robot_description/pr2_robot_defs/cal_base.xml (rev 0)
+++ pkg/trunk/robot_descriptions/wg_robot_description/pr2_robot_defs/cal_base.xml 2008-10-17 22:49:22 UTC (rev 5519)
@@ -0,0 +1,23 @@
+<controllers>
+ <macro name="caster_calibrator" params="suffix">
+ <controller type="CasterCalibrationControllerNode"
+ name="cal_caster_${suffix}" topic="cal_caster_${suffix}">
+ <calibrate joint="caster_${suffix}_joint"
+ actuator="caster_${suffix}_motor"
+ transmission="caster_${suffix}_trans"
+ velocity="1.0" />
+ <joints caster="caster_${suffix}_joint"
+ wheel_l="wheel_${suffix}_l_joint"
+ wheel_r="wheel_${suffix}_r_joint" />
+ <caster_pid p="6" i="0" d="0" iClamp="0" />
+ <wheel_pid p="4" i="0" d="0" iClamp="0" />
+ </controller>
+ </macro>
+
+
+ <caster_calibrator suffix="front_left" />
+ <caster_calibrator suffix="front_right" />
+ <caster_calibrator suffix="rear_left" />
+ <caster_calibrator suffix="rear_right" />
+
+</controllers>
Added: pkg/trunk/robot_descriptions/wg_robot_description/pr2_robot_defs/cal_head.xml
===================================================================
--- pkg/trunk/robot_descriptions/wg_robot_description/pr2_robot_defs/cal_head.xml (rev 0)
+++ pkg/trunk/robot_descriptions/wg_robot_description/pr2_robot_defs/cal_head.xml 2008-10-17 22:49:22 UTC (rev 5519)
@@ -0,0 +1,21 @@
+<controllers>
+
+ <controller name="cal_head_pan" topic="cal_head_pan"
+ type="JointCalibrationControllerNode">
+ <calibrate joint="head_pan_joint"
+ actuator="head_pan_motor"
+ transmission="head_pan_trans"
+ velocity="1.5" />
+ <pid p="0.4" i="0.0" d="0" iClamp="1.0" />
+ </controller>
+
+ <controller name="cal_head_tilt" topic="cal_head_tilt"
+ type="JointCalibrationControllerNode">
+ <calibrate joint="head_tilt_joint"
+ actuator="head_tilt_motor"
+ transmission="head_tilt_trans"
+ velocity="0.7" />
+ <pid p="0.3" i="0.0" d="0" iClamp="5.0" />
+ </controller>
+
+</controllers>
Added: pkg/trunk/robot_descriptions/wg_robot_description/pr2_robot_defs/cal_torso.xml
===================================================================
--- pkg/trunk/robot_descriptions/wg_robot_description/pr2_robot_defs/cal_torso.xml (rev 0)
+++ pkg/trunk/robot_descriptions/wg_robot_description/pr2_robot_defs/cal_torso.xml 2008-10-17 22:49:22 UTC (rev 5519)
@@ -0,0 +1,10 @@
+<controllers>
+ <controller type="JointCalibrationControllerNode"
+ name="cal_torso" topic="cal_torso">
+ <calibrate joint="torso_joint"
+ actuator="torso_motor"
+ transmission="torso_trans"
+ velocity="9.0" />
+ <pid p="1.0" i="0.4" d="0" iClamp="2" />
+ </controller>
+</controllers>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|