Alexandre Simon / Mbed 2 deprecated Poppy_Ergo_Jr

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Poppy_Arm.h Source File

Poppy_Arm.h

00001 /*******************************************************************************
00002 This library was developed at ECAM Lyon by Alexandre Simon
00003 
00004 This library is designed for the Ergo Jr arm from the Poppy project available at
00005 https://www.poppy-project.org/en/robots/poppy-ergo-jr
00006 
00007 In order to work correctly, the Ergo Jr arm must imperatively be put together
00008 following the instructions available at
00009 https://docs.poppy-project.org/en/assembly-guides/ergo-jr/
00010 mechanical-construction.html
00011 otherwise, the equations of the coordinates of the tip of the arm will not be
00012 correct.
00013 
00014 You should also check in the Poppy_Arm constructor if the dimensions of your arm
00015 are correct and you must change the code accordingly.
00016 *******************************************************************************/
00017 
00018 #ifndef Poppy_Arm_H
00019 #define Poppy_Arm_H
00020 
00021 #include "XL320_Driver.h"
00022 
00023 #define PI 3.1415926
00024 
00025 class Poppy_Arm : public XL320
00026 {
00027 public:
00028     Poppy_Arm(uint32_t baudrate, PinName tx, PinName rx);
00029     ~Poppy_Arm();
00030 
00031     uint8_t initNewServo(uint32_t currentBaudRate, uint32_t newBaudRate, uint8_t newId);
00032     void ChristmasTree();
00033     void FindCoordinates();
00034     void CalculateCoordinates(double angle[]);
00035     void MoveToCoordinates(double x, double y, double z);
00036     double GetCoordinates(uint8_t Coord);
00037     void OpenClamp(bool open);
00038 
00039 private:
00040     uint8_t dim[6];     //Dimensions of the arm
00041     double coord[3];    //Coordinates of the tip of the arm
00042 };
00043 
00044 #endif