diff --git a/src/examples/darwin_action_test.cpp b/src/examples/darwin_action_test.cpp index 740e75f3a405e91cb6937e1650c4f4b861774e78..98fd7dfe3efdc31d13b38a6d51587b236a8c2403 100644 --- a/src/examples/darwin_action_test.cpp +++ b/src/examples/darwin_action_test.cpp @@ -4,8 +4,8 @@ #include <iostream> -//std::string robot_device="A603LOBS"; -std::string robot_device="A4008atn"; +std::string robot_device="A603LOBS"; +//std::string robot_device="A4008atn"; int main(int argc, char *argv[]) { diff --git a/src/examples/darwin_adc_test.cpp b/src/examples/darwin_adc_test.cpp index de3b241e9d1cc613b195f76e0d35479ff37794ae..adbf5bdd4e143ee970e0ed0c4fff4ec598928cb9 100644 --- a/src/examples/darwin_adc_test.cpp +++ b/src/examples/darwin_adc_test.cpp @@ -3,8 +3,8 @@ #include <iostream> -//std::string robot_device="A603LOBS"; -std::string robot_device="A4008atn"; +std::string robot_device="A603LOBS"; +//std::string robot_device="A4008atn"; int main(int argc, char *argv[]) { diff --git a/src/examples/darwin_joint_motion_test.cpp b/src/examples/darwin_joint_motion_test.cpp index 20a39c8659599478aadbe789a58590e328385b9c..64d0a27db4b479dfdec8fb0e409d835791bb4d4a 100644 --- a/src/examples/darwin_joint_motion_test.cpp +++ b/src/examples/darwin_joint_motion_test.cpp @@ -35,23 +35,41 @@ int main(int argc, char *argv[]) angles.clear(); speeds.clear(); accels.clear(); + servos.push_back(23); + servos.push_back(22); servos.push_back(19); angles.push_back(45.0); + angles.push_back(45.0); + angles.push_back(45.0); + speeds.push_back(50.0); speeds.push_back(50.0); + speeds.push_back(50.0); + accels.push_back(50.0); + accels.push_back(50.0); accels.push_back(50.0); std::cout << "Start joint_motion ..." << std::endl; darwin.joints_load(JOINTS_GRP0,servos,angles,speeds,accels); darwin.joints_start(JOINTS_GRP0); - sleep(2); - darwin.joints_stop(JOINTS_GRP0); - std::cout << "done" << std::endl; + while(darwin.joints_are_moving(JOINTS_GRP0)) + { + std::cout << "moving joints ..." << std::endl; + usleep(100000); + } servos.clear(); angles.clear(); speeds.clear(); accels.clear(); + servos.push_back(23); + servos.push_back(22); servos.push_back(19); angles.push_back(-45.0); + angles.push_back(-45.0); + angles.push_back(-45.0); speeds.push_back(50.0); + speeds.push_back(50.0); + speeds.push_back(50.0); + accels.push_back(50.0); + accels.push_back(50.0); accels.push_back(50.0); darwin.joints_load(JOINTS_GRP0,servos,angles,speeds,accels); darwin.joints_start(JOINTS_GRP0); diff --git a/src/examples/darwin_manager_test.cpp b/src/examples/darwin_manager_test.cpp index 7b3fd220292239dd30c5afb51336febe620dec32..309308403e0071ec4eec2650c8cd2e4eb81c3767 100644 --- a/src/examples/darwin_manager_test.cpp +++ b/src/examples/darwin_manager_test.cpp @@ -3,21 +3,22 @@ #include <iostream> -//std::string robot_device="A603LOBS"; -std::string robot_device="A4008atn"; -std::string config_file="../src/xml/darwin_action.xml"; +std::string robot_device="A603LOBS"; +//std::string robot_device="A4008atn"; int main(int argc, char *argv[]) { int i=0,num_servos; + unsigned int present_servos; std::vector<int> servos; std::vector<double> angles,speeds,accels,offsets; try{ CDarwinRobot darwin("Darwin",robot_device,1000000,0x02); - darwin.mm_load_config(config_file); num_servos=darwin.mm_get_num_servos(); - std::cout << "Found " << num_servos << " servos" << std::endl; + present_servos=darwin.mm_get_present_servos(); + std::cout << "Found " << num_servos << " servos " << std::endl; + std::cout << "Present servos: " << present_servos << std::hex << "0x" << present_servos << std::dec << std::endl; std::cout << "Motion manager period " << darwin.mm_get_period() << " ms" << std::endl; // execute the walk ready action std::cout << "Assign servos to the action module" << std::endl;