REPY-2.0 1.0
Mechanical module for modular robotics
repy_module.h
00001 //------------------------------------------------------------------------------
00002 //-- REPY module
00003 //------------------------------------------------------------------------------
00004 //-- This file belongs to the REPY-2.0 module project:
00005 //--
00006 //--    · http://www.dsquaredrobotics.com/wiki/index.php?title=REPY-2.0
00007 //--
00008 //--
00009 //-- REPY-2.0 was designed using the 00ML (Object-Oriented Mechanics Library).
00010 //-- More info about the OOML at:
00011 //--    · http://iearobotics.com/oomlwiki/doku.php
00012 //--
00013 //-- REPY-2.0 concept is deeply based on Juan Gonzalez-Gomez REPY module. More
00014 //-- info about the original REPY at:
00015 //--    · http://www.thingiverse.com/thing:13442
00016 //--    · http://www.iearobotics.com/wiki/index.php?title=M%C3%B3dulos_REPY-1
00017 //--
00018 //------------------------------------------------------------------------------
00019 //-- Author: David Estevez (DEF)
00020 //--
00021 //-- Released under the GPL license (more info on LICENSE.txt file)
00022 //------------------------------------------------------------------------------
00023 
00036 #ifndef REPY_MODULE_H
00037 #define REPY_MODULE_H
00038 
00039 #include <ooml/core.h>
00040 #include <ooml/components.h>
00041 
00042 #include "servos/basicservo.h"
00043 #include "boards/basicsquaredpcb.h"
00044 
00052 class REPY_module : public AbstractPart
00053 {
00054 public:
00062     REPY_module(BasicServo& servo,  BasicSquaredPCB& pcb);
00063 
00064 
00065 
00066     //-- Configuring the module:
00067     //--------------------------------------------------------------------------------
00076     void configRender( bool show_servo = true, bool show_assembly = true, bool show_lower = true, bool show_upper = true );
00077 
00085     void configHorn( int num_arms, int cut_part = 20.5/2.0 - 3);
00086 
00087 
00088     //-- Data interface (for reading the module attributes)
00089     //--------------------------------------------------------------------------------
00090     //-- Module components:
00091     //---------------------------------------
00093     Component get_lower_part();
00094 
00096     Component get_upper_part();
00097 
00099     BasicServo * get_servo();
00100 
00102     BasicSquaredPCB * get_pcb();
00103 
00105     Component get_fake_axis();
00106 
00108     Component get_fake_axis_with_tol();
00109 
00110 
00111     //-- Lower part data:
00112     //-------------------------------------
00114     double get_lower_base_thickness();
00115 
00117     double get_lower_front_ear_thickness();
00118 
00120     double get_lower_back_ear_thickness();
00121 
00123     double get_lower_ear_shift();
00124 
00126     double get_lower_ear_radius();
00127 
00129     double get_lower_screw_safe();
00130 
00132     double get_lower_border_safe();
00133 
00134 
00135     //-- Upper part data:
00136     //--------------------------------------
00138     double get_upper_base_thickness();
00139 
00141     double get_upper_front_ear_thickness();
00142 
00144     double get_upper_back_ear_thickness();
00145 
00147     double get_upper_ear_shift();
00148 
00150     double get_upper_ear_radius();
00151 
00153     double get_upper_screw_safe();
00154 
00156     double get_upper_border_safe();
00157 
00158     //-- Tolerances:
00159     //--------------------------------------
00161     double get_body_servo_x_tol();
00162 
00164     double get_body_servo_y_tol();
00165 
00167     double get_ear_clearance_tol();
00168 
00170     double get_fake_axis_tol();
00171 
00172 
00173     //-- Visibility flags:
00174     //---------------------------------------
00176     bool get_show_servo();
00177 
00179     bool get_show_assembly();
00180 
00182     bool get_show_lower();
00183 
00185     bool get_show_upper();
00186 
00187 
00188     //-- Dimensions calculated by the software to build the module:
00189     //-------------------------------------
00191     double get_side();
00192 
00194     double get_central_part();
00195 
00196 
00197 protected:
00198 
00200     virtual Component build();
00201 
00202 private:
00204     Component lower_part();
00205 
00207     Component upper_part();
00208 
00216     Component make_ear( double base, double height, double thickness, double shift, double radius);
00217 
00218     //-- Needed components that define the module:
00219     //--------------------------------------------
00227     Component lower, upper;
00228 
00234     BasicServo * servo;
00235 
00241     BasicSquaredPCB * pcb;
00242 
00252     Component fake_axis, fake_axis_with_tol;
00253 
00254 
00255     //-- Needed dimensions
00256     //-------------------------------------------------------------------------------
00257     //-- General:
00258     //---------------------------------------------
00262     double board_safe;
00263 
00264     //-- Lower part:
00265     //---------------------------------------------
00289     double lower_base_thickness;
00290     double lower_front_ear_thickness;
00291     double lower_back_ear_thickness;
00292     double lower_ear_shift;
00293     double lower_ear_radius;
00294     double lower_screw_safe;
00295     double lower_border_safe;
00296 
00297     //-- Upper part:
00298     //-----------------------------------------------
00322     double upper_base_thickness;
00323     double upper_front_ear_thickness;
00324     double upper_back_ear_thickness;
00325     double upper_ear_shift;
00326     double upper_ear_radius;
00327     double upper_screw_safe;
00328     double upper_border_safe;
00329 
00330     //-- Tolerances:
00331     //------------------------------------------------
00346     double body_servo_x_tol;
00347     double body_servo_y_tol;
00348     double ear_clearance_tol;
00349     double fake_axis_tol;
00350 
00351     //-- Visibility flags:
00352     //-----------------------------------------------
00369     bool show_servo;
00370     bool show_assembly;
00371     bool show_lower;
00372     bool show_upper;
00373 
00374     //-- Dimensions calculated automatically by the software:
00375     //-------------------------------------------------------
00384     double side;
00385     double central_part;
00386 };
00387 
00388 #endif // REPY_MODULE_H
 All Classes Functions Variables