CORC Project
CANOpen Robot Controller Software Documentation
DummyActJoint.cpp
Go to the documentation of this file.
1 
11 #include "DummyActJoint.h"
12 
13 #include <iostream>
14 
15 #include "DebugMacro.h"
16 
17 DummyActJoint::DummyActJoint(int jointID, double jointMin, double jointMax, Drive *drive) : ActuatedJoint(jointID, jointMin, jointMax, drive) {
18  DEBUG_OUT("MY JOINT ID: " << this->id)
19  // Do nothing else
20 }
21 
23  drive->getPos();
24  q = lastQCommand;
25 
26  return true;
27 }
28 
30  lastQCommand = desQ;
31  return ActuatedJoint::setPosition(desQ);
32 }
33 
35  DEBUG_OUT("Joint::initNetwork()")
36  if (drive->initPDOs()) {
37  return true;
38  } else {
39  return false;
40  }
41 }
43  return q;
44 }
Defines some macros for debugging output.
Abstract class describing a Drive used to communicate with a CANbus device. Note that many functions ...
Definition: Drive.h:105
bool initNetwork()
Pure virtual function for initialising the underlying CANopen Network to send and recieve PDO message...
A dummy class to test whether the actuated joint inheritence stuff works.
double q
Definition: Joint.h:33
double lastQCommand
Definition: DummyActJoint.h:24
virtual bool initPDOs()
Initialises a standard set of PDOs for the use of the drive. These are:
Definition: Drive.cpp:95
virtual int getPos()
Definition: Drive.cpp:39
setMovementReturnCode_t
Definition: ActuatedJoint.h:35
Abstract class representing an actuated joint in a Robot Class (extending joint). Requires a Drive ob...
Definition: ActuatedJoint.h:47
DummyActJoint(int jointID, double jointMin, double jointMax, Drive *drive)
Drive * drive
Contains a Drive object, which is a CANOpen device which is used to control the physical hardware...
Definition: ActuatedJoint.h:54
virtual setMovementReturnCode_t setPosition(double desQ)
Set the Position object.
bool updateValue()
Updates the value of the joint. This will read the value from hardware, and update the software&#39;s cur...
#define DEBUG_OUT(x)
Definition: DebugMacro.h:19
setMovementReturnCode_t setPosition(double desQ)
Set the Position object.