|
REPY-2.0 1.0
Mechanical module for modular robotics
|
Constructor. Takes a BasicServo and a BasicSquaredPCB and generates the module parameters.
{
this->servo = &servo;
this->pcb = &pcb;
//-- Coeffients relating x and y proportions with respect to a
//-- futaba servo:
double x_coeff = servo.get_width() / 20.5;
double y_coeff = servo.get_length() / 41.0;
double z_coeff = servo.get_height() / 39.5;
//-- Default dimensions:
//-- General:
board_safe = 1.5;
//-- Lower part:
lower_base_thickness = 4 * z_coeff;
lower_front_ear_thickness = 4 * y_coeff;
lower_back_ear_thickness = 4 * y_coeff;
lower_ear_shift = 12 * z_coeff;
lower_ear_radius = 38/2.0 * x_coeff;
lower_screw_safe = 4;
lower_border_safe = 7;
//-- Upper part:
upper_base_thickness = 4 * z_coeff;
upper_front_ear_thickness = 5.5 * y_coeff;
upper_back_ear_thickness = 4 * y_coeff;
upper_ear_shift = 12 * z_coeff;
upper_ear_radius = 38/2.0 * x_coeff;
upper_screw_safe = 5;
upper_border_safe = 7;
//-- Tolerances:
body_servo_x_tol = 0.5;
body_servo_y_tol = 1;
ear_clearance_tol = 0.5;
fake_axis_tol = 0.5;
//-- Default flags:
show_servo = false;
show_assembly = false;
show_lower = false;
show_upper = true;
//-- Set default horn configuration:
this->servo->set_horn( 0, 0, true, 20.5/2.0 - 3);
rebuild();
}
|
1.7.4