Skip to content
Snippets Groups Projects
Commit 00e92d3a authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Removed the static variables from some functions.

Implemented the thread in a non-static function.
Tested the execution of several CTrajectory modules at the same time.
parent 35c682fa
No related branches found
No related tags found
No related merge requests found
......@@ -46,16 +46,20 @@ int main(int argc, char *argv[])
{
CMotorTest motor;
CEventServer *event_server=CEventServer::instance();
CTrajectory<CMotorTest> traj("trajectory",&motor,&CMotorTest::stop,&CMotorTest::get_current_angles,&CMotorTest::move_absolute_angles,
&CMotorTest::move_relative_angles,&CMotorTest::get_num_motors);
CTrajectory<CMotorTest> traj1("trajectory1",&motor,&CMotorTest::stop,&CMotorTest::get_current_angles,&CMotorTest::move_absolute_angles,
&CMotorTest::move_relative_angles,&CMotorTest::get_num_motors);
CTrajectory<CMotorTest> traj2("trajectory2",&motor,&CMotorTest::stop,&CMotorTest::get_current_angles,&CMotorTest::move_absolute_angles,
&CMotorTest::move_relative_angles,&CMotorTest::get_num_motors);
try{
#ifdef _HAVE_XSD
traj.load_trajectory(sequence_filename);
traj.start_trajectory();
while(!event_server->event_is_set(traj.get_trajectory_complete_event_id()))
traj1.load_trajectory(sequence_filename);
traj1.start_trajectory();
traj2.load_trajectory(sequence_filename);
traj2.start_trajectory();
while(!event_server->event_is_set(traj1.get_trajectory_complete_event_id()))
{
std::cout << traj.get_trajectory_completed_percentage() << "% of sequence completed" << std::endl;
std::cout << traj1.get_trajectory_completed_percentage() << "% of sequence completed" << std::endl;
usleep(200000);
}
#endif
......
#include "trajectory.h"
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment