|
REPY-2.0 1.0
Mechanical module for modular robotics
|
Sets the different default dimensions of the horn after a change in the horn main characteristics. Implements BasicServo. {
//-- Horn tolerance
horn_tol = 0;
//-- Color (black)
horn_color.push_back( 0.5); //-- Red
horn_color.push_back( 0.5); //-- Green
horn_color.push_back( 0.5); //-- Blue
horn_color.push_back( 1.0); //-- Alpha channel
//-- Set parameters depending on the number of arms of the servo horn:
//--------------------------------------------------------------------
switch( horn_num_arms )
{
default:
horn_num_arms = 0;
case 0:
//-- Rounded horn:
horn_h_top = 3;
horn_r_top = 20.5 / 2.0;
horn_h_axis = 3.5;
horn_r_axis = 9 / 2.0;
//-- Not needed for rounded horn:
horn_arm_r = 0;
horn_arm_shift = 0;
horn_arm_dist = 0;
break;
case 2:
//-- 2-arms horn:
horn_h_top = 3;
horn_r_top = 12.5 / 2.0;
horn_h_axis = 3;
horn_r_axis = 9 / 2.0;
horn_arm_r = 5 / 2.0;
horn_arm_shift = 0;
horn_arm_dist = 19 - 5 / 2.0;
break;
case 4:
//-- 4-arms horn:
horn_h_top = 3;
horn_r_top = 13.5 / 2.0;
horn_h_axis = 3;
horn_r_axis = 9 / 2.0;
horn_arm_r = 4.5 / 2.0;
horn_arm_shift = 7;
horn_arm_dist = 18 - 4.5 / 2.0;
break;
case 6:
//-- 6-arms horn:
horn_h_top = 3;
horn_r_top = 15 / 2.0;
horn_h_axis = 3;
horn_r_axis = 9 / 2.0;
horn_arm_r = 5 / 2.0;
horn_arm_shift = 0;
horn_arm_dist = (31.5 - 5) / 2.0;
break;
}
rebuild();
}
|
1.7.4