REPY-2.0 1.0
Mechanical module for modular robotics
basicservo.h
00001 //------------------------------------------------------------------------------
00002 //-- Basic servo
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 
00035 #ifndef BASIC_SERVO_H
00036 #define BASIC_SERVO_H
00037 
00038 #include <ooml/core.h>
00039 #include <ooml/components.h>
00040 
00047 class BasicServo: public AbstractPart
00048 {
00049 public:
00050     //-- Object dimensions interface:
00051     //-------------------------------------------------------------------
00052 
00053     //-- Main dimensions:
00054     //----------------------------------------
00056     double get_width();
00057 
00059     double get_length();
00060 
00062     double get_height();
00063 
00064     //-- Leg dimensions:
00065     //-----------------------------------------
00067     double get_leg_h();
00068 
00070     double get_leg_x();
00071 
00073     double get_leg_y();
00074 
00076     double get_leg_z();
00077 
00078     //-- Leg holes
00079     //-----------------------------------------
00081     int get_num_holes();
00082 
00084     double get_hole_r();
00085 
00087     double get_hole_x();
00088 
00090     double get_hole_y();
00091 
00092     //-- Axis dimensions:
00093     //-----------------------------------------
00095     double get_axis_h();
00096 
00098     double get_axis_r();
00099 
00101     double get_axis_y();
00102 
00103     //-- Horn positioning:
00104     //-----------------------------------------
00106     double get_horn_dist_axis();
00107 
00108     //-- Tolerances:
00109     //-----------------------------------------
00111     double get_width_tol();
00112 
00114     double get_length_tol();
00115 
00117     double get_height_tol();
00118 
00119 
00120     //-- Horn dimensions:
00121     //------------------------------------------
00123     double get_horn_num_arms();
00124 
00126     double get_horn_h_top();
00127 
00129     double get_horn_r_top();
00130 
00132     double get_horn_h_axis();
00133 
00135     double get_horn_r_axis();
00136 
00138     double get_horn_arm_r();
00139 
00141     double get_horn_arm_shift();
00142 
00146     double get_horn_arm_dist();
00147 
00149     double get_horn_tol();
00150 
00152     double get_horn_cut();
00153 
00154     //-- Horn (others):
00155     //------------------------------------------
00157     bool horn_shown();
00158 
00160     Component get_horn();
00161 
00163     double get_horn_angle();
00164 
00165     //-- Servo configuration:
00166     //-----------------------------------------------------------------
00173     void set_horn( int arms, double angle = 0, bool visibility = true, double cut = 0);
00174 
00175 
00182     void set_tolerances( double width_tol, double length_tol, double height_tol );
00183 
00184 protected:
00186     BasicServo();
00187 
00191     virtual void update_horn() = 0;
00192 
00194     virtual Component build();
00195 
00197     virtual void make_horn();
00198 
00199     //-- Servo characteristics:
00200     //------------------------------------------------------------------
00201     //-- Main dimensions:
00212     double width, length, height;
00213 
00214     //-- Leg dimensions:
00228     double leg_h, leg_x, leg_y, leg_z;
00229 
00230     //-- Leg holes
00244     int num_holes;
00245     double  hole_r, hole_x, hole_y;
00246 
00247     //-- Axis dimensions:
00258     double axis_h, axis_r, axis_y;
00259 
00260     //-- Horn positioning:
00264     double horn_dist_axis;
00265 
00266     //-- Tolerances:
00277     double width_tol;
00278     double length_tol;
00279     double height_tol;
00280 
00281     //-- Color:
00290     std::vector<double> servo_color;
00291 
00292     //-- Horn characteristics:
00293     //----------------------------------------
00297     Component horn;
00298 
00302     bool display_horn;
00303 
00307     int horn_num_arms;
00308 
00315     double horn_h_top, horn_r_top;
00316 
00323     double horn_h_axis, horn_r_axis;
00324 
00335     double horn_arm_r, horn_arm_shift, horn_arm_dist;
00336 
00340     double horn_tol;
00341 
00348     double horn_cut; //-- For cutting the round horn.
00349 
00350     //-- Horn color:
00359     std::vector<double> horn_color;
00360 
00361     //-- Horn position:
00367     double horn_angle;
00368 };
00369 
00370 
00371 #endif // BASIC_SERVO_H
 All Classes Functions Variables