17 if(ethercatMaster->isThreadActive()){
29 setAngle.angle = 0 * radian;
30 setVel.angularVelocity = 0 * radian_per_second;
31 currentSetpoint.current = 0 * ampere;
41 YouBotBase myBase(
"youbot-base", CONFIG_FOLDER_PATH);
45 if (!ethercatMaster->isThreadActive()) {
46 ethercatMaster->sendProcessData();
47 ethercatMaster->receiveProcessData();
57 startTime = myTrace.getTimeDurationMilliSec();
58 overallTime = startTime + durationNull + stepStartTime + durationNull;
60 while (myTrace.getTimeDurationMilliSec() < overallTime) {
61 if (myTrace.getTimeDurationMilliSec() > startTime + durationNull) {
62 setAngle.angle = 0 * radian;
64 if (myTrace.getTimeDurationMilliSec() > startTime + durationNull
65 && myTrace.getTimeDurationMilliSec() < startTime + durationNull + stepStartTime) {
66 setAngle.angle = 2 * radian;
68 if (myTrace.getTimeDurationMilliSec() > startTime + durationNull + stepStartTime) {
69 setAngle.angle = 0 * radian;
73 if (!ethercatMaster->isThreadActive()) {
74 ethercatMaster->sendProcessData();
75 ethercatMaster->receiveProcessData();
77 myTrace.updateTrace(setAngle);
87 YouBotBase myBase(
"youbot-base", CONFIG_FOLDER_PATH);
91 if (!ethercatMaster->isThreadActive()) {
92 ethercatMaster->sendProcessData();
93 ethercatMaster->receiveProcessData();
103 startTime = myTrace.getTimeDurationMilliSec();
104 overallTime = startTime + durationNull + stepStartTime + durationNull;
106 while (myTrace.getTimeDurationMilliSec() < overallTime) {
107 if (myTrace.getTimeDurationMilliSec() > startTime + durationNull) {
108 setVel.angularVelocity = 0 * radian_per_second;
110 if (myTrace.getTimeDurationMilliSec() > startTime + durationNull
111 && myTrace.getTimeDurationMilliSec() < startTime + durationNull + stepStartTime) {
112 setVel.angularVelocity = 2 * radian_per_second;
114 if (myTrace.getTimeDurationMilliSec() > startTime + durationNull + stepStartTime) {
115 setVel.angularVelocity = 0 * radian_per_second;
119 if (!ethercatMaster->isThreadActive()) {
120 ethercatMaster->sendProcessData();
121 ethercatMaster->receiveProcessData();
123 myTrace.updateTrace(setVel);
133 YouBotBase myBase(
"youbot-base", CONFIG_FOLDER_PATH);
137 if (!ethercatMaster->isThreadActive()) {
138 ethercatMaster->sendProcessData();
139 ethercatMaster->receiveProcessData();
141 myTrace.startTrace();
149 startTime = myTrace.getTimeDurationMilliSec();
150 overallTime = startTime + durationNull + stepStartTime + durationNull;
152 while (myTrace.getTimeDurationMilliSec() < overallTime) {
153 if (myTrace.getTimeDurationMilliSec() > startTime + durationNull) {
154 currentSetpoint.current = 0 * ampere;
156 if (myTrace.getTimeDurationMilliSec() > startTime + durationNull
157 && myTrace.getTimeDurationMilliSec() < startTime + durationNull + stepStartTime) {
158 currentSetpoint.current = 0.5 * ampere;
160 if (myTrace.getTimeDurationMilliSec() > startTime + durationNull + stepStartTime) {
161 currentSetpoint.current = 0 * ampere;
165 if (!ethercatMaster->isThreadActive()) {
166 ethercatMaster->sendProcessData();
167 ethercatMaster->receiveProcessData();
169 myTrace.updateTrace(currentSetpoint);
virtual void setData(const JointDataSetpoint &data)
virtual void setConfigurationParameter(const JointParameter ¶meter)
static severity_level logginLevel
Clear the flag that indicates a communication timeout between the EtherCAT master and the controller...
YouBotJoint & getBaseJoint(const unsigned int baseJointNumber)
#define SLEEP_MICROSEC(microsec)
static void destroy()
destroy the singleton instance by calling the destructor
Creates a trace of all process data and reads all configuration parameter from one joint...
YouBotBaseTestWithoutThread()
virtual ~YouBotBaseTestWithoutThread()
void YouBotBaseTestWithoutThread_PositionMode()
It groups the base joints together.
void doJointCommutation()
does the sine commutation of the base joints
static EthercatMasterInterface & getInstance(const std::string configFile="youbot-ethercat.cfg", const std::string configFilePath="../config/", const bool ethercatMasterWithThread=true)
void setEncoderToZero()
set the encoder values of the joint to zero. This postion will be the new reference.
void YouBotBaseTestWithoutThread_CurrentMode()
void YouBotBaseTestWithoutThread_VelocityMode()