55 #include <sys/select.h> 89 RoboClaw(
const char *deviceName,
const char *baudRateParam);
119 int drive(
float value);
124 int turn(
float value);
216 static uint16_t
_calcCRC(
const uint8_t *buf,
size_t n, uint16_t
init = 0);
243 uint8_t *rbuff,
size_t rbytes,
bool send_checksum =
true,
bool recv_checksum =
false);
actuator_armed_s _actuatorArmed
void _parameters_update()
int _sendNothing(e_command)
struct timeval _uart_timeout
float getMotorPosition(e_motor motor)
int readEncoder()
read data from serial
struct RoboClaw::@20 _parameters
static bool taskShouldExit
parameter_update_s _paramUpdate
e_channel
control channels
actuator_controls_s _actuatorControls
RoboClaw(const char *deviceName, const char *baudRateParam)
constructor
int setMotorSpeed(e_motor motor, float value)
set the speed of a motor, rev/sec
param_t encoder_read_period_ms
int _actuatorsSub
actuator controls subscription
Global flash based parameter store.
int turn(float value)
Turn.
wheel_encoders_s _wheelEncoderMsg[2]
int32_t encoder_read_period_ms
float getMotorSpeed(e_motor motor)
orb_advert_t _wheelEncodersAdv[2]
param_t actuator_write_period_ms
void init()
Activates/configures the hardware registers.
int resetEncoders()
reset the encoders
void printStatus(char *string, size_t n)
print status
__BEGIN_DECLS typedef void * orb_advert_t
ORB topic advertiser handle.
int setMotorDutyCycle(e_motor motor, float value)
set the duty cycle of a motor
int _sendUnsigned7Bit(e_command command, float data)
int _sendSigned16Bit(e_command command, float data)
uint32_t _lastEncoderCount[2]
int _transaction(e_command cmd, uint8_t *wbuff, size_t wbytes, uint8_t *rbuff, size_t rbytes, bool send_checksum=true, bool recv_checksum=false)
Perform a round-trip write and read.
static uint16_t _calcCRC(const uint8_t *buf, size_t n, uint16_t init=0)
int64_t _encoderCounts[2]
int drive(float value)
Drive both motors.
int32_t actuator_write_period_ms
virtual ~RoboClaw()
deconstructor
struct RoboClaw::@21 _param_handles
This is a driver for the RoboClaw motor controller.
uint32_t param_t
Parameter handle.
Base class for devices connected via I2C.