51 #include "rnr/rnrconfig.h" 55 #include <gtest/gtest.h> 79 TEST(RoboteqSmall, sanity)
86 static int testRoboteqSmallOpenClose()
89 string devName=
"/dev/ttyACM0";
91 if(mot.
open(devName, baudRate)!=0)
93 fprintf(stderr,
"jnt failed to open\n");
99 fprintf(stderr,
"jnt failed to close\n");
105 TEST(RoboteqSmall, openClose)
107 EXPECT_TRUE(testRoboteqSmallOpenClose() == 0);
110 static int testRoboteqSmallSetSpeed()
113 string devName=
"/dev/ttyACM0";
115 if(mot.
open(devName, baudRate)!=0)
117 fprintf(stderr,
"jnt failed to open\n");
148 TEST(RoboteqSmall, setSpeed)
150 EXPECT_TRUE(testRoboteqSmallSetSpeed() == 0);
153 static int testRoboteqSmallSetSpeedVec()
156 string devName=
"/dev/ttyACM0";
158 if(mot.
open(devName, baudRate)!=0)
160 fprintf(stderr,
"jnt failed to open\n");
164 Mot::VecSpeedTupples motSpeeds;
178 motSpeeds.push_back(tmp);
182 motSpeeds.push_back(tmp);
193 motSpeeds.push_back(tmp);
197 motSpeeds.push_back(tmp);
199 mot.
setSpeed(motSpeeds);brakeStepSize
205 motSpeeds.push_back(tmp);
209 motSpeeds.push_back(tmp);
217 motSpeeds.push_back(tmp);
221 motSpeeds.push_back(tmp);
229 motSpeeds.push_back(tmp);
233 motSpeeds.push_back(tmp);
241 motSpeeds.push_back(tmp);
245 motSpeeds.push_back(tmp);
267 TEST(RoboteqSmall, setSpeedVec)
269 EXPECT_TRUE(testRoboteqSmallSetSpeedVec() == 0);
int setVoltageLimits(int lowVoltage, int overVoltage)
Function sets the minimum and maximum limits for applied voltage for all motors.
static int testRoboteqSmallSanity()
Sanity test Roboteq-small interface.
int setSpeedProfile(int motID, int accel, int decel=DEF_DEC)
Function retrieves value for voltage applied to a single motor.
Common Human Interface Device Interface.
int setSpeed(int motID, float speed, units_t units=units_norm)
Description.
int setCurrentLimits(int motID, int current, units_t units=units_amp)
Function sets minimum and maximum limits for current.
int open(const std::string &devName, int baudRate)
Function opens serial communication with motor controller device.
int close()
Function closes serial communication with motor controller device.
int getVoltageLimits()
Function retrieves value for current load on a single motor.
RoadNarrows Robotics standard namespace.
int getCurrentLimits()
Function determines if a motor controller can monitor current.
int stop(int motID)
Function stops motor specified.
int getVoltage()
Function retrieves value for voltage applied to a single motor.
TEST(Xbox360, XboxSanity)
Sanity test Xbox360 controller interface.