00001
00002 import numpy as np
00003 import math
00004
00005 height = 0.0
00006 l1 = 0.185-0.085
00007 l2 = 0.085
00008 l3 = 0.09
00009 l4 = 0.278-0.09
00010 l4_offset = 0.00635
00011 l5 = 0.065
00012 l6 = 0.279-0.065
00013 lee = 0.1
00014 lee_block = 0.04
00015
00016 upper_arm = 0.25
00017
00018 lower_arm = 0.25
00019 arm_thck = 0.07
00020 ee_length = 0.10
00021
00022 ee_location = np.matrix([0., -l1-l2, height-l3-l4-l5-l6-lee_block]).T
00023 bod_shapes = ['cube', 'cube', 'cube', 'cube', 'cube', 'cube']
00024 bod_dimensions = [[arm_thck, l2, arm_thck], [arm_thck, arm_thck, l3],
00025 [arm_thck, arm_thck, l4], [arm_thck, arm_thck, l5],
00026 [arm_thck, arm_thck, l6], [arm_thck, arm_thck, lee_block]]
00027
00028
00029 bod_com_position = [[0., -l1-l2/2.0, height],
00030 [0., -l1-l2, height-l3/2.0],
00031 [0., -l1-l2, height-l3-l4/2.0],
00032 [0., -l1-l2, height-l3-l4-l5/2.0],
00033 [0., -l1-l2, height-l3-l4-l5-l6/2.0],
00034 [0., -l1-l2, height-l3-l4-l5-l6-lee_block/2.0]]
00035
00036
00037 bod_color = [[0.4, 0.4, 0.4, 1], [0.8, 0.8, 0.8, 1], [0.33, 0.3, 0.33, 1],
00038 [0.4, 0.4, 0.4, 1], [0.8, 0.8, 0.8, 1], [0.33, 0.33, 0.33, 1]]
00039
00040 bod_num_links = 6
00041 bod_mass = [2.0, 0.636, 2.3, 0.339, 1.18, 0.32]
00042
00043
00044
00045
00046 bod_names = ['link1', 'link2', 'link3', 'link4', 'link5', 'link6', 'link7']
00047 bodies ={'shapes':bod_shapes, 'dim':bod_dimensions, 'num_links':bod_num_links,
00048 'com_pos':bod_com_position, 'mass':bod_mass, 'name':bod_names, 'color':bod_color}
00049
00050
00051
00052
00053
00054
00055
00056
00057 b_jt_axis = [[0.,-1.0,0.],[-1.,0.,0.], [0., 0., -1.], [0.,-1.,0.], [0., 0., -1.], [0., 1., 0.]]
00058 b_jt_anchor = [[0., -l1, height], [0., -l1-l2, height],
00059 [0., -l1-l2, height-l3],
00060 [0., -l1-l2, height-l3-l4],
00061 [0., -l1-l2, height-l3-l4-l5],
00062 [0., -l1-l2, height-l3-l4-l5-l6]]
00063
00064 b_num_jts = 6
00065 b_jt_limits_max = np.radians([ 120., 122., 77.5, 144., 122., 45.]).tolist()
00066 b_jt_limits_min = np.radians([ -47.61, -20., -77.5, -5.0, -80., -45.]).tolist()
00067 b_jt_attach = [[0, -1], [1, 0], [2,1], [3,2], [4,3], [5,4]]
00068 b_jt_start = np.radians([0., 0., 0., 0., 0., 0.]).tolist()
00069
00070 b_jts = {'anchor':b_jt_anchor, 'axis':b_jt_axis, 'jt_lim_max':b_jt_limits_max,
00071 'jt_lim_min':b_jt_limits_min, 'jt_init':b_jt_start, 'jt_attach':b_jt_attach, 'num_jts':b_num_jts}
00072
00073
00074
00075 if __name__ == '__main__':
00076 import roslib; roslib.load_manifest('darpa_m3')
00077 import rospy
00078
00079
00080
00081
00082 rospy.init_node('arm_config_upload')
00083 rospy.set_param('m3/software_testbed/joints/axes', b_jts['axis'])
00084 rospy.set_param('m3/software_testbed/joints/anchor', b_jts['anchor'])
00085 rospy.set_param('m3/software_testbed/joints/max', b_jts['jt_lim_max'])
00086 rospy.set_param('m3/software_testbed/joints/min', b_jts['jt_lim_min'])
00087 rospy.set_param('m3/software_testbed/joints/attach', b_jts['jt_attach'])
00088 rospy.set_param('m3/software_testbed/joints/init_angle', b_jts['jt_init'])
00089 rospy.set_param('m3/software_testbed/joints/num_joints', b_jts['num_jts'])
00090 rospy.set_param('m3/software_testbed/linkage/dimensions', bodies['dim'])
00091 rospy.set_param('m3/software_testbed/linkage/colors', bodies['color'])
00092 rospy.set_param('m3/software_testbed/linkage/mass', bodies['mass'])
00093 rospy.set_param('m3/software_testbed/linkage/positions', bodies['com_pos'])
00094 rospy.set_param('m3/software_testbed/linkage/num_links', bodies['num_links'])
00095 rospy.set_param('m3/software_testbed/linkage/shapes', bodies['shapes'])
00096 rospy.set_param('m3/software_testbed/linkage/link_names', bodies['name'])
00097
00098
00099