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

Updated some basic functions.

parent bc79283a
No related branches found
No related tags found
No related merge requests found
SET(DARWIN_FW_PATH ~/humanoids/darwin_stm32_fw)
ADD_SUBDIRECTORY(xml)
IF(HAVE_XSD)
ADD_DEFINITIONS(-D_HAVE_XSD)
......@@ -38,7 +36,6 @@ ENDIF(EIGEN3_FOUND)
# add the necessary include directories
INCLUDE_DIRECTORIES(.)
INCLUDE_DIRECTORIES(${DARWIN_FW_PATH}/include)
INCLUDE_DIRECTORIES(${iriutils_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${dynamixel_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${EIGEN3_INCLUDE_DIR})
......
This diff is collapsed.
This diff is collapsed.
......@@ -4,63 +4,63 @@ ADD_EXECUTABLE(darwin_manager_test darwin_manager_test.cpp)
TARGET_LINK_LIBRARIES(darwin_manager_test darwin_robot)
# create an example application
ADD_EXECUTABLE(darwin_gpio_test darwin_gpio_test.cpp)
#ADD_EXECUTABLE(darwin_gpio_test darwin_gpio_test.cpp)
# link necessary libraries
TARGET_LINK_LIBRARIES(darwin_gpio_test darwin_robot)
#TARGET_LINK_LIBRARIES(darwin_gpio_test darwin_robot)
# create an example application
ADD_EXECUTABLE(darwin_adc_test darwin_adc_test.cpp)
#ADD_EXECUTABLE(darwin_adc_test darwin_adc_test.cpp)
# link necessary libraries
TARGET_LINK_LIBRARIES(darwin_adc_test darwin_robot)
#TARGET_LINK_LIBRARIES(darwin_adc_test darwin_robot)
# create an example application
ADD_EXECUTABLE(darwin_imu_test darwin_imu_test.cpp)
#ADD_EXECUTABLE(darwin_imu_test darwin_imu_test.cpp)
# link necessary libraries
TARGET_LINK_LIBRARIES(darwin_imu_test darwin_robot)
#TARGET_LINK_LIBRARIES(darwin_imu_test darwin_robot)
# create an example application
ADD_EXECUTABLE(darwin_action_test darwin_action_test.cpp)
#ADD_EXECUTABLE(darwin_action_test darwin_action_test.cpp)
# link necessary libraries
TARGET_LINK_LIBRARIES(darwin_action_test darwin_robot)
#TARGET_LINK_LIBRARIES(darwin_action_test darwin_robot)
# create an example application
ADD_EXECUTABLE(darwin_walking_test darwin_walking_test.cpp)
#ADD_EXECUTABLE(darwin_walking_test darwin_walking_test.cpp)
# link necessary libraries
TARGET_LINK_LIBRARIES(darwin_walking_test darwin_robot)
#TARGET_LINK_LIBRARIES(darwin_walking_test darwin_robot)
# create an example application
ADD_EXECUTABLE(darwin_stairs_test darwin_stairs_test.cpp)
#ADD_EXECUTABLE(darwin_stairs_test darwin_stairs_test.cpp)
# link necessary libraries
TARGET_LINK_LIBRARIES(darwin_stairs_test darwin_robot)
#TARGET_LINK_LIBRARIES(darwin_stairs_test darwin_robot)
# create an example application
ADD_EXECUTABLE(darwin_joint_motion_test darwin_joint_motion_test.cpp)
#ADD_EXECUTABLE(darwin_joint_motion_test darwin_joint_motion_test.cpp)
# link necessary libraries
TARGET_LINK_LIBRARIES(darwin_joint_motion_test darwin_robot)
#TARGET_LINK_LIBRARIES(darwin_joint_motion_test darwin_robot)
# create an example application
ADD_EXECUTABLE(darwin_head_tracking_test darwin_head_tracking_test.cpp)
#ADD_EXECUTABLE(darwin_head_tracking_test darwin_head_tracking_test.cpp)
# link necessary libraries
TARGET_LINK_LIBRARIES(darwin_head_tracking_test darwin_robot)
#TARGET_LINK_LIBRARIES(darwin_head_tracking_test darwin_robot)
IF(KDL_FOUND)
#IF(KDL_FOUND)
# create an example application
ADD_EXECUTABLE(darwin_arm_kin darwin_arm_kin.cpp)
# ADD_EXECUTABLE(darwin_arm_kin darwin_arm_kin.cpp)
# link necessary libraries
TARGET_LINK_LIBRARIES(darwin_arm_kin darwin_arm_kinematics)
# TARGET_LINK_LIBRARIES(darwin_arm_kin darwin_arm_kinematics)
# create an example application
ADD_EXECUTABLE(darwin_leg_kin darwin_leg_kin.cpp)
# ADD_EXECUTABLE(darwin_leg_kin darwin_leg_kin.cpp)
# link necessary libraries
TARGET_LINK_LIBRARIES(darwin_leg_kin darwin_leg_kinematics)
ENDIF(KDL_FOUND)
# TARGET_LINK_LIBRARIES(darwin_leg_kin darwin_leg_kinematics)
#ENDIF(KDL_FOUND)
# create an example application
ADD_EXECUTABLE(darwin_smart_charger_test darwin_smart_charger_test.cpp)
#ADD_EXECUTABLE(darwin_smart_charger_test darwin_smart_charger_test.cpp)
# link necessary libraries
TARGET_LINK_LIBRARIES(darwin_smart_charger_test darwin_robot)
#TARGET_LINK_LIBRARIES(darwin_smart_charger_test darwin_robot)
# create an example application
ADD_EXECUTABLE(darwin_gripper_test darwin_gripper_test.cpp)
#ADD_EXECUTABLE(darwin_gripper_test darwin_gripper_test.cpp)
# link necessary libraries
TARGET_LINK_LIBRARIES(darwin_gripper_test darwin_robot)
#TARGET_LINK_LIBRARIES(darwin_gripper_test darwin_robot)
......@@ -3,25 +3,39 @@
#include <iostream>
std::string robot_device="A603LOBS";
//std::string robot_device="A603LOBS";
//std::string robot_device="A4008atn";
std::string robot_device="/tmp/darwin_driver";
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;
// 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);
num_servos=darwin.mm_get_num_servos();
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;
CDarwinRobot darwin("Darwin",robot_device,1000000,0x01,true);
std::cout << "Manager period: " << darwin.manager_get_period() << std::endl;
std::cout << "Number of modules: " << darwin.manager_get_num_modules() << std::endl;
std::cout << "Number of masters: " << darwin.managet_get_num_masters() << std::endl;
std::cout << "Motion manager period: " << darwin.mm_get_period() << std::endl;
darwin.manager_start();
darwin.manager_start_scan();
while(darwin.manager_is_scanning())
{
std::cout << "scanning ..." << std::endl;
usleep(100000);
}
std::cout << "num. devices: " << (int)darwin.manager_get_num_devices() << std::endl;
// num_servos=darwin.mm_get_num_servos();
// 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;
// std::cout << "Assign servos to the action module" << std::endl;
/*
for(i=1;i<=20;i++)
{
darwin.mm_enable_servo(i);
......@@ -88,6 +102,7 @@ int main(int argc, char *argv[])
offsets=darwin.mm_get_servo_offsets();
for(i=0;i<MAX_NUM_SERVOS;i++)
std::cout << " Servo " << i << ": " << offsets[i] << std::endl;
*/
}catch(CException &e){
std::cout << e.what() << std::endl;
}
......
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