32 CO_errorReport(CO->em, CO_EM_GENERIC_SOFTWARE_ERROR, CO_EMC_SOFTWARE_INTERNAL, info);
33 fprintf(stderr,
"canopend generic error: 0x%X\n", info);
37 std::cout <<
"This is a script to test the implementation of the Joints, ActuatedJoints and Drive Classes! \n";
39 std::cout <<
"1. Construct a CopleyDrive Object (which implements Drive Class) \n";
43 std::cout <<
"2. Construct a TestActJoint Object (Cast as a ActuatedJoint), using the testDrive Object \n";
46 std::cout <<
"Read the ID of the Joint (Expected Value 1): " << normalJoint->
getId() <<
"\n";
47 std::cout <<
"Read Node ID of the Drive (Expected Value 100): " << testDrive->
getNodeID() <<
"\n";
49 std::cout <<
"Read Value of the Joint (Expected Value 0): " << normalJoint->
getQ() <<
"\n";
51 std::cout <<
"Set the Joint into Position Control Mode: " << normalJoint->
setMode(
POSITION_CONTROL, testProfile) <<
"\n";
53 std::cout <<
"Set the position of the Joint to 1 (expected result: true): " << normalJoint->
setPosition(1) <<
"\n";
55 std::cout <<
"Read Value of the Joint (Expected Value 0): " << normalJoint->
getQ() <<
"\n";
57 std::cout <<
"Call a updateValue() defined in Joint: " << normalJoint->
updateValue() <<
"\n";
59 std::cout <<
"Read Value of the Joint (Expected Value 1): " << normalJoint->
getQ() <<
"\n";
62 std::cout <<
"Set the Joint into Velocity Control Mode: " << normalJoint->
setMode(
VELOCITY_CONTROL, testProfile) <<
"\n";
64 std::cout <<
"Set the position of the Joint to 1 (expected result: true): " << normalJoint->
setVelocity(100) <<
"\n";
66 std::cout <<
"Read Value of the Joint (Expected Value 0): " << normalJoint->
getQ() <<
"\n";
68 std::cout <<
"Call a updateValue() defined in Joint: " << normalJoint->
updateValue() <<
"\n";
70 std::cout <<
"Read Value of the Joint (Expected Value 1): " << normalJoint->
getQ() <<
"\n";
int getNodeID()
Get returns the CanNode ID.
Abstract class describing a Drive used to communicate with a CANbus device. Note that many functions ...
volatile uint32_t CO_timer1ms
void CO_errExit(char *msg)
Example implementation of the ActuatedJoints class.
A dummy class to test whether the actuated joint inheritence stuff works.
The ActuatedJoint class is a abstract class which represents a joint in a Robot objec. This class implements the Joint class, and specifically represents a joint which is actuated. This therefore requires a Drive object which will be used to interact with the physical hardware.
virtual ControlMode setMode(ControlMode driveMode_, motorProfile profile)
Set the mode of the device (nominally, position, velocity or torque control)
An implementation of the Drive Object, specifically for the Copley Drive.
double getQ()
Returns the internal value of the joint (e.g. Angle, length, depending on joint type) ...
The Joint class is a abstract class which represents a joint in a Robot objec. This class can be used...
Abstract class representing an actuated joint in a Robot Class (extending joint). Requires a Drive ob...
An implementation of the Drive Object, specifically for Copley-branded devices (currently used on the...
virtual setMovementReturnCode_t setPosition(double desQ)
Set the Position object.
struct to hold desired velocity, acceleration and deceleration values for a drives motor controller p...
virtual setMovementReturnCode_t setVelocity(double velocity)
Sets a velocity set point (in joint units)
The Drive class is used to interface with a CANOpen motor drive. According to the CiA402 standard...
virtual bool updateValue()=0
Updates the value of the joint. This will read the value from hardware, and update the software's cur...
pthread_mutex_t CO_CAN_VALID_mtx
int getId()
Get the Id object.
void CO_error(const uint32_t info)