Go to the documentation of this file.
51 bool setAngle(
double angle,
const uint8_t servo = 0,
bool fast =
false);
74 double angle,
const uint8_t servo = 0,
bool fast =
false);
101 ASSERT_(factor > 0 && factor < 1);
117 void setOffsets(
float offset0,
float offset1,
float offset2);
bool checkConnectionAndConnect()
Tries to connect to the USB device (if disconnected).
A USB-interface for a custom "robotic neck" designed at MAPIR lab.
unsigned __int16 uint16_t
unsigned int m_NumPrevAngles
Number of previous angles to store for averaging.
bool queryFirmwareVersion(std::string &out_firmwareVersion)
Gets the firmware version of the eNeck board.
bool setRegisterValueAndSpeed(const uint16_t value, const uint8_t servo, const uint16_t speed)
unsigned int angle2RegValue(const double angle)
Converts from a decimal angle (in radians) to the corresponding register value for the ATMEGA16 contr...
bool center(const uint8_t servo=0)
Centers the servo at zero position.
bool setAngleWithFilter(double angle, const uint8_t servo=0, bool fast=false)
Turns the servo up to the specified angle (in radians in the range -pi,pi) filtered by average with t...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
bool setAngle(double angle, const uint8_t servo=0, bool fast=false)
Turns the servo up to the specified angle (in radians in the range -pi,pi, other values will be satur...
#define ASSERT_(f)
Defines an assertion mechanism.
std::vector< float > m_offsets
The offset used for each servo.
void setNumberOfPreviousAngles(const unsigned int number)
Gets the truncate factor of the turn.
bool disableServo(const uint8_t servo=0)
Disables the servo so the neck will be loose.
A definition of a CStream actually representing a USB connection to a FTDI chip.
bool getCurrentAngle(double &angle, const uint8_t servo=0)
Gets the current angle of the servo (in radians within (-pi,pi))
void setOffsets(float offset0, float offset1, float offset2)
Load the Offset values for each servo.
std::string m_usbSerialNumber
A copy of the device serial number (to open the USB FTDI chip).
double getTruncateFactor()
Gets the truncate factor of the turn.
unsigned int getNumberOfPreviousAngles()
Gets the truncate factor of the turn.
void setTruncateFactor(const double factor)
Gets the truncate factor of the turn.
bool getRegisterValue(uint16_t &value, const uint8_t servo=0)
double m_TruncateFactor
The range of turn of the servo will be truncated to "+-m_truncate_factor*(pi/2)".
double m_MaxValue
The value set in the ICR register within the ATMEGA16 controller.
bool enableServo(const uint8_t servo=0)
Enables the servo so the neck will be tight.
GLsizei const GLfloat * value
std::deque< double > m_PrevAngles
A vector containing the last N angles which where passed to the servo (for averaging)
bool setAngleAndSpeed(double angle, const uint8_t servo, const uint8_t speed)
Turns the servo up to the specified angle (in radians in the range -pi,pi, other values will be satur...
bool setRegisterValue(const uint16_t value, const uint8_t servo=0, bool fast=false)
GLsizei const GLchar ** string
double regValue2angle(const uint16_t value)
Converts from a certain value of the ATMEGA16 PWM register to the corresponding decimal angle (for in...
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |