Laelaps  2.3.5
RoadNarrows Robotics Small Outdoor Mobile Robot Project
RoboClaw.cxx File Reference

RoboClaw motor controller class implementation. More...

#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <string>
#include "rnr/rnrconfig.h"
#include "rnr/log.h"
#include "rnr/serdev.h"
#include "Laelaps/RoboClaw.h"

Go to the source code of this file.

Macros

#define ROBOCLAW_TRY_MOTOR(motor)
 Test for valid motor index. More...
 
#define ROBOCLAW_DBG(addr, cmdNum, fmt, ...)
 Debug print disabled.
 
#define ROBOCLAW_DBG_MSG(addr, cmdNum, buf, len, fmt, ...)
 Debug print message disabled.
 
#define ROBOCLAW_DBG_BUF(buf, len, fmt, ...)
 Debug print buffer disabled.
 

Functions

s64_t iabs (s64_t a)
 Integer absolute value. More...
 

Variables

static RoboClawChipSelect csNoOp
 

Detailed Description

RoboClaw motor controller class implementation.

LastChangedDate
2016-04-13 11:47:47 -0600 (Wed, 13 Apr 2016)
Rev
4386
Author
Robin Knight (robin.nosp@m..kni.nosp@m.ght@r.nosp@m.oadn.nosp@m.arrow.nosp@m.s.co.nosp@m.m)
Copyright
© 2015-2017. RoadNarrows LLC.
http://www.roadnarrows.com
All Rights Reserved

Definition in file RoboClaw.cxx.

Macro Definition Documentation

#define ROBOCLAW_TRY_MOTOR (   motor)
Value:
do \
{ \
if( !isValidMotor(motor) ) \
{ \
LOGERROR("Motor controller 0x%02x: Motor index %d invalid.", \
m_address, motor); \
return RC_ERROR; \
} \
} while(0)
Definition: RoboClaw.h:64

Test for valid motor index.

This macro only within RoboClaw methods.

Parameters
motorMotor index.
Returns
On failure, forces return from calling function with the appropriate error code.debug switch

Definition at line 78 of file RoboClaw.cxx.

Referenced by motor::roboclaw::RoboClaw::cmdDutyDrive2(), motor::roboclaw::RoboClaw::cmdQDrive2(), motor::roboclaw::RoboClaw::cmdQDriveForDist(), motor::roboclaw::RoboClaw::cmdQDriveWithAccel(), motor::roboclaw::RoboClaw::cmdQDriveWithAccelForDist(), motor::roboclaw::RoboClaw::cmdQDriveWithProfileToPos(), motor::roboclaw::RoboClaw::cmdReadEncoderMode(), and motor::roboclaw::RoboClaw::cmdReadQSpeed().

Function Documentation

s64_t iabs ( s64_t  a)
inline

Integer absolute value.

Parameters
aInteger value.
Returns
|a|

Definition at line 176 of file RoboClaw.cxx.

Referenced by laelaps::LaeKinematics::isStopped(), and laelaps::LaeKinematics::senseDynamics().

176 {
177  m_addrLast = 0;
178 }
179 

Variable Documentation

RoboClawChipSelect csNoOp
static

Fixed no-op selection object.

Definition at line 202 of file RoboClaw.cxx.

Referenced by motor::roboclaw::RoboClawComm::RoboClawComm().