From: Kyle Maroney Date: Tue, 1 May 2012 16:37:22 +0000 (+0000) Subject: Wiping original trunk directory for WAM ROS development X-Git-Url: http://git.ece.ufrgs.br/?a=commitdiff_plain;h=495aa5ebc9bc78a1e6550a828ba90ec24d9b6463;p=barrett-ros-pkg.git Wiping original trunk directory for WAM ROS development --- diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 28105dd..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -cmake_minimum_required(VERSION 2.4.6) -include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake) - -# Append to CPACK_SOURCE_IGNORE_FILES a semicolon-separated list of -# directories (or patterns, but directories should suffice) that should -# be excluded from the distro. This is not the place to put things that -# should be ignored everywhere, like "build" directories; that happens in -# rosbuild/rosbuild.cmake. Here should be listed packages that aren't -# ready for inclusion in a distro. -# -# This list is combined with the list in rosbuild/rosbuild.cmake. Note -# that CMake 2.6 may be required to ensure that the two lists are combined -# properly. CMake 2.4 seems to have unpredictable scoping rules for such -# variables. -#list(APPEND CPACK_SOURCE_IGNORE_FILES /core/experimental) - -rosbuild_make_distribution(0.1.0) diff --git a/Makefile b/Makefile deleted file mode 100644 index a818cca..0000000 --- a/Makefile +++ /dev/null @@ -1 +0,0 @@ -include $(shell rospack find mk)/cmake_stack.mk \ No newline at end of file diff --git a/libbarrett_ros/Makefile b/libbarrett_ros/Makefile deleted file mode 100644 index e29ddda..0000000 --- a/libbarrett_ros/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -all: installed - -SVN_DIR = libbarrett -SVN_URL = http://web.barrett.com/svn/libbarrett/trunk/ -#SVN_REVISION = -r 808 -#SVN_PATCH = -include $(shell rospack find mk)/svn_checkout.mk -SOURCE_DIR = $(SVN_DIR) - - -installed: wiped $(SOURCE_DIR) - cd $(SOURCE_DIR) && cmake . - cd $(SOURCE_DIR) && make - cd $(SOURCE_DIR) && make install - touch installed - -clean: - rm -rf $(SVN_DIR) installed patched wiped rospack_nosubdirs - - -wiped: Makefile - make wipe - touch wiped - -wipe: clean - rm -rf build cleaned diff --git a/libbarrett_ros/manifest.xml b/libbarrett_ros/manifest.xml deleted file mode 100644 index ae8bb9b..0000000 --- a/libbarrett_ros/manifest.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - Libbarrett robot control library ROS wrapper. Libbarrett is written and maintained by Barrett Technology. - - - Barrett Technology, Inc. - BSD - http://ros.org/wiki/libbarrett - - - - - - - - - - diff --git a/stack.xml b/stack.xml deleted file mode 100644 index 920119e..0000000 --- a/stack.xml +++ /dev/null @@ -1,9 +0,0 @@ - - barrett-ros-pkg - Barrett Technology Inc. - BSD - - http://ros.org/wiki/barrett-ros-pkg - - - diff --git a/wam_description/CMakeLists.txt b/wam_description/CMakeLists.txt deleted file mode 100644 index e09bf68..0000000 --- a/wam_description/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -cmake_minimum_required(VERSION 2.4.6) -include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake) - -rosbuild_init() - -#common commands for building c++ executables and libraries -#rosbuild_add_library(${PROJECT_NAME} src/example.cpp) -#target_link_libraries(${PROJECT_NAME} another_library) -#rosbuild_add_boost_directories() -#rosbuild_link_boost(${PROJECT_NAME} thread) -#rosbuild_add_executable(example examples/example.cpp) -#target_link_libraries(example ${PROJECT_NAME}) diff --git a/wam_description/Makefile b/wam_description/Makefile deleted file mode 100644 index b75b928..0000000 --- a/wam_description/Makefile +++ /dev/null @@ -1 +0,0 @@ -include $(shell rospack find mk)/cmake.mk \ No newline at end of file diff --git a/wam_description/launch/wam_4dof.launch b/wam_description/launch/wam_4dof.launch deleted file mode 100644 index 92b8174..0000000 --- a/wam_description/launch/wam_4dof.launch +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/wam_description/launch/wam_7dof.launch b/wam_description/launch/wam_7dof.launch deleted file mode 100644 index 082a247..0000000 --- a/wam_description/launch/wam_7dof.launch +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/wam_description/launch/wam_7dof_ft_hand.launch b/wam_description/launch/wam_7dof_ft_hand.launch deleted file mode 100644 index af9e525..0000000 --- a/wam_description/launch/wam_7dof_ft_hand.launch +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/wam_description/launch/wam_7dof_hand.launch b/wam_description/launch/wam_7dof_hand.launch deleted file mode 100644 index 70ad149..0000000 --- a/wam_description/launch/wam_7dof_hand.launch +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/wam_description/manifest.xml b/wam_description/manifest.xml deleted file mode 100644 index 8938de5..0000000 --- a/wam_description/manifest.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - 4-DOF WAM, 7-DOF WAM, BarrettHand, and FT Sensor meshes and urdfs - for description of Barrett Technology's products. - - - Kyle Maroney, Barrett Technology Inc. - BSD - - - http://ros.org/wiki/wam_description - - - - - - - - - - - - diff --git a/wam_description/meshes/bhand_base.mesh b/wam_description/meshes/bhand_base.mesh deleted file mode 100644 index 8179497..0000000 Binary files a/wam_description/meshes/bhand_base.mesh and /dev/null differ diff --git a/wam_description/meshes/bhand_ftsensor.mesh b/wam_description/meshes/bhand_ftsensor.mesh deleted file mode 100644 index 751fa87..0000000 Binary files a/wam_description/meshes/bhand_ftsensor.mesh and /dev/null differ diff --git a/wam_description/meshes/bhand_link1.mesh b/wam_description/meshes/bhand_link1.mesh deleted file mode 100644 index 7fe8b2b..0000000 Binary files a/wam_description/meshes/bhand_link1.mesh and /dev/null differ diff --git a/wam_description/meshes/bhand_link2.mesh b/wam_description/meshes/bhand_link2.mesh deleted file mode 100644 index ee31b3d..0000000 Binary files a/wam_description/meshes/bhand_link2.mesh and /dev/null differ diff --git a/wam_description/meshes/bhand_link3.mesh b/wam_description/meshes/bhand_link3.mesh deleted file mode 100644 index c8ecc26..0000000 Binary files a/wam_description/meshes/bhand_link3.mesh and /dev/null differ diff --git a/wam_description/meshes/link_j1.mesh b/wam_description/meshes/link_j1.mesh deleted file mode 100644 index 9181e20..0000000 Binary files a/wam_description/meshes/link_j1.mesh and /dev/null differ diff --git a/wam_description/meshes/link_j2.mesh b/wam_description/meshes/link_j2.mesh deleted file mode 100644 index 5420ad5..0000000 Binary files a/wam_description/meshes/link_j2.mesh and /dev/null differ diff --git a/wam_description/meshes/link_j3.mesh b/wam_description/meshes/link_j3.mesh deleted file mode 100644 index 53ba501..0000000 Binary files a/wam_description/meshes/link_j3.mesh and /dev/null differ diff --git a/wam_description/meshes/link_j4.mesh b/wam_description/meshes/link_j4.mesh deleted file mode 100644 index c4399b5..0000000 Binary files a/wam_description/meshes/link_j4.mesh and /dev/null differ diff --git a/wam_description/meshes/link_j5.mesh b/wam_description/meshes/link_j5.mesh deleted file mode 100644 index 68607fd..0000000 Binary files a/wam_description/meshes/link_j5.mesh and /dev/null differ diff --git a/wam_description/meshes/link_j6.mesh b/wam_description/meshes/link_j6.mesh deleted file mode 100644 index 844d9d3..0000000 Binary files a/wam_description/meshes/link_j6.mesh and /dev/null differ diff --git a/wam_description/meshes/link_j7.mesh b/wam_description/meshes/link_j7.mesh deleted file mode 100644 index ec49086..0000000 Binary files a/wam_description/meshes/link_j7.mesh and /dev/null differ diff --git a/wam_description/meshes/wam_base.mesh b/wam_description/meshes/wam_base.mesh deleted file mode 100644 index 081e9ba..0000000 Binary files a/wam_description/meshes/wam_base.mesh and /dev/null differ diff --git a/wam_description/urdf/wam_4dof.urdf b/wam_description/urdf/wam_4dof.urdf deleted file mode 100644 index 4005123..0000000 --- a/wam_description/urdf/wam_4dof.urdf +++ /dev/null @@ -1,266 +0,0 @@ - - - #Fictional Footprint - for integration - - - - - - - - - - - - - - - - - - - - - - #WAM BASE - - - - - - - - - - - - - - - - - - - - - - - - - #LINK J1 - - - - - - - - - - - - - - - - - - - - - - #LINK J2 - - - - - - - - - - - - - - - - - - - - - - #LINK J3 - - - - - - - - - - - - - - - - - - - - - - #LINK J4 - - - - - - - - - - - - - - - - - - - - - - - ## Joint Descriptions - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #Adding Gazebo Requirements - - Gazebo/White - true - - - - Gazebo/White - true - true - - - - Gazebo/White - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - #Adding Transmissions - - - - 1 - 1 - - - - - - 1 - 1 - - - - - - 1 - 1 - - - - - - 1 - 1 - - - \ No newline at end of file diff --git a/wam_description/urdf/wam_7dof.urdf b/wam_description/urdf/wam_7dof.urdf deleted file mode 100644 index 9493a5f..0000000 --- a/wam_description/urdf/wam_7dof.urdf +++ /dev/null @@ -1,399 +0,0 @@ - - - #Fictional Footprint - for integration - - - - - - - - - - - - - - - - - - - - - - #WAM BASE - - - - - - - - - - - - - - - - - - - - - - - - #LINK J1 - - - - - - - - - - - - - - - - - - - - - #LINK J2 - - - - - - - - - - - - - - - - - - - - - #LINK J3 - - - - - - - - - - - - - - - - - - - - - #LINK J4 - - - - - - - - - - - - - - - - - - - - - - #LINK J5 - - - - - - - - - - - - - - - - - - - - - - #LINK J6 - - - - - - - - - - - - - - - - - - - - - - #LINK J7 - - - - - - - - - - - - - - - - - - - - - - ## Joint Descriptions - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #Adding Gazebo Requirements - - Gazebo/White - true - - - - Gazebo/White - true - true - - - - Gazebo/White - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - #Adding Transmissions - - - - 1 - 1 - - - - - - 1 - 1 - - - - - - 1 - 1 - - - - - - 1 - 1 - - - - - - 1 - 1 - - - - - - 1 - 1 - - - - - - 1 - 1 - - \ No newline at end of file diff --git a/wam_description/urdf/wam_7dof_ft_hand.urdf b/wam_description/urdf/wam_7dof_ft_hand.urdf deleted file mode 100644 index 04590cf..0000000 --- a/wam_description/urdf/wam_7dof_ft_hand.urdf +++ /dev/null @@ -1,831 +0,0 @@ - - - #Fictional Footprint - for integration - - - - - - - - - - - - - - - - - - - - - - #WAM BASE - - - - - - - - - - - - - - - - - - - - - - - - #LINK J1 - - - - - - - - - - - - - - - - - - - - - #LINK J2 - - - - - - - - - - - - - - - - - - - - - #LINK J3 - - - - - - - - - - - - - - - - - - - - - #LINK J4 - - - - - - - - - - - - - - - - - - - - - - #LINK J5 - - - - - - - - - - - - - - - - - - - - - - #LINK J6 - - - - - - - - - - - - - - - - - - - - - - #LINK J7 - - - - - - - - - - - - - - - - - - - - - - #LINK FT SENSOR - - - - - - - - - - - - - - - - - - - - - - #LINK BHAND BASE - - - - - - - - - - - - - - - - - - - - - - #FINGERS - - #LINK BHAND LINK F11 - - - - - - - - - - - - - - - - - - - - - - #LINK BHAND LINK F21 - - - - - - - - - - - - - - - - - - - - - - #LINK BHAND LINK F12 - - - - - - - - - - - - - - - - - - - - - - #LINK BHAND LINK F22 - - - - - - - - - - - - - - - - - - - - - - #LINK BHAND LINK F32 - - - - - - - - - - - - - - - - - - - - - - #LINK BHAND LINK F13 - - - - - - - - - - - - - - - - - - - - - - #LINK BHAND LINK F23 - - - - - - - - - - - - - - - - - - - - - - #LINK BHAND LINK F33 - - - - - - - - - - - - - - - - - - - - - - ## Joint Descriptions - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #Adding Gazebo Requirements - - Gazebo/White - true - - - - Gazebo/White - true - true - - - - Gazebo/White - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - #Adding Transmissions - - - - 1 - 1 - - - - - - 1 - 1 - - - - - - 1 - 1 - - - - - - 1 - 1 - - - - - - 1 - 1 - - - - - - 1 - 1 - - - - - - 1 - 1 - - - #FINGER TRANSMISSIONS - - - - - 1 - 1 - - - - - - 1 - 1 - - - - - - 1 - 1 - - - - - - 1 - 1 - - - - - - 1 - 1 - - - - - - 1 - 1 - - - - - - 1 - 1 - - - - - - 1 - 1 - - - \ No newline at end of file diff --git a/wam_description/urdf/wam_7dof_hand.urdf b/wam_description/urdf/wam_7dof_hand.urdf deleted file mode 100644 index 064b9ee..0000000 --- a/wam_description/urdf/wam_7dof_hand.urdf +++ /dev/null @@ -1,797 +0,0 @@ - - - #Fictional Footprint - for integration - - - - - - - - - - - - - - - - - - - - - - #WAM BASE - - - - - - - - - - - - - - - - - - - - - - - - #LINK J1 - - - - - - - - - - - - - - - - - - - - - #LINK J2 - - - - - - - - - - - - - - - - - - - - - #LINK J3 - - - - - - - - - - - - - - - - - - - - - #LINK J4 - - - - - - - - - - - - - - - - - - - - - - #LINK J5 - - - - - - - - - - - - - - - - - - - - - - #LINK J6 - - - - - - - - - - - - - - - - - - - - - - #LINK J7 - - - - - - - - - - - - - - - - - - - - - - #LINK BHAND BASE - - - - - - - - - - - - - - - - - - - - - - #FINGERS - - #LINK BHAND LINK F11 - - - - - - - - - - - - - - - - - - - - - - #LINK BHAND LINK F21 - - - - - - - - - - - - - - - - - - - - - - #LINK BHAND LINK F12 - - - - - - - - - - - - - - - - - - - - - - #LINK BHAND LINK F22 - - - - - - - - - - - - - - - - - - - - - - #LINK BHAND LINK F32 - - - - - - - - - - - - - - - - - - - - - - #LINK BHAND LINK F13 - - - - - - - - - - - - - - - - - - - - - - #LINK BHAND LINK F23 - - - - - - - - - - - - - - - - - - - - - - #LINK BHAND LINK F33 - - - - - - - - - - - - - - - - - - - - - - ## Joint Descriptions - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #Adding Gazebo Requirements - - Gazebo/White - true - - - - Gazebo/White - true - true - - - - Gazebo/White - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - - Gazebo/Grey - true - true - - - #Adding Transmissions - - - - 1 - 1 - - - - - - 1 - 1 - - - - - - 1 - 1 - - - - - - 1 - 1 - - - - - - 1 - 1 - - - - - - 1 - 1 - - - - - - 1 - 1 - - - #FINGER TRANSMISSIONS - - - - - 1 - 1 - - - - - - 1 - 1 - - - - - - 1 - 1 - - - - - - 1 - 1 - - - - - - 1 - 1 - - - - - - 1 - 1 - - - - - - 1 - 1 - - - - - - 1 - 1 - - - \ No newline at end of file diff --git a/wam_node/CMakeLists.txt b/wam_node/CMakeLists.txt deleted file mode 100644 index fe3e436..0000000 --- a/wam_node/CMakeLists.txt +++ /dev/null @@ -1,34 +0,0 @@ -cmake_minimum_required(VERSION 2.4.6) -include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake) - -# Set the build type. Options are: -# Coverage : w/ debug symbols, w/o optimization, w/ code-coverage -# Debug : w/ debug symbols, w/o optimization -# Release : w/o debug symbols, w/ optimization -# RelWithDebInfo : w/ debug symbols, w/ optimization -# MinSizeRel : w/o debug symbols, w/ optimization, stripped binaries -#set(ROS_BUILD_TYPE RelWithDebInfo) -rosbuild_find_ros_package(actionlib_msgs) -include(${actionlib_msgs_PACKAGE_PATH}/cmake/actionbuild.cmake) -genaction() - -rosbuild_init() - -#set the default path for built executables to the "bin" directory -set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin) -#set the default path for built libraries to the "lib" directory -set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib) - -rosbuild_genmsg() -rosbuild_gensrv() - -link_directories(/usr/xenomai/lib /usr/local/lib) -rosbuild_add_executable(wam_node src/wam_node.cpp) -include_directories(/usr/xenomai/include /usr/local/include /usr/local/include/eigen2 /usr/local/include/boost) -add_definitions(-D_GNU_SOURCE -D_REENTRANT -D__XENO__) -rosbuild_add_compile_flags(wam_node -Wall -pipe) -target_link_libraries(wam_node barrett native xenomai pthread rt gsl gslcblas m boost_signals boost_thread) -#rosbuild_add_boost_directories() -#rosbuild_link_boost(wam_node thread) - - diff --git a/wam_node/Makefile b/wam_node/Makefile deleted file mode 100644 index b75b928..0000000 --- a/wam_node/Makefile +++ /dev/null @@ -1 +0,0 @@ -include $(shell rospack find mk)/cmake.mk \ No newline at end of file diff --git a/wam_node/manifest.xml b/wam_node/manifest.xml deleted file mode 100644 index 888de4a..0000000 --- a/wam_node/manifest.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - Barrett Technology ROS node for 4-DOF and 7-DOF WAM. - - - Barrett Technology Inc., Kyle Maroney - BSD - - http://ros.org/wiki/wam_node - - - - - - - - - - diff --git a/wam_node/src/wam_node.cpp b/wam_node/src/wam_node.cpp deleted file mode 100644 index 96c7a29..0000000 --- a/wam_node/src/wam_node.cpp +++ /dev/null @@ -1,255 +0,0 @@ -#include - -#include "ros/ros.h" -#include "wam_node/GravityComp.h" -#include "wam_node/JointMove.h" -#include "wam_node/CartMove.h" -#include "std_srvs/Empty.h" -#include "sensor_msgs/JointState.h" -#include "geometry_msgs/PoseStamped.h" - -#include -#include -#include -#include -#include -#include - -static const int PUBLISH_FREQ = 1; - -using namespace barrett; - -bool grav_state = true; -int wam_dof = 0; -systems::Wam<4>* wam4 = NULL; -systems::Wam<7>* wam7 = NULL; -units::JointPositions<4>::type* jp4; -units::JointPositions<4>::type* jp4home; -units::JointPositions<7>::type* jp7; -units::JointPositions<7>::type* jp7home; -units::CartesianPosition::type* cpp; -Eigen::Quaterniond to; -Eigen::Quaterniond tog; - -class WamNode -{ -protected: - //ros::NodeHandle n_; - sensor_msgs::JointState joint_state; - geometry_msgs::PoseStamped wam_pose; - ros::Publisher joint_pub; - ros::Publisher pose_pub; - ros::ServiceServer gravity_srv; - ros::ServiceServer jmove_srv; - ros::ServiceServer cmove_srv; - ros::ServiceServer home_srv; - -public: - WamNode(){} - - void init(std::vector &dof) - { - WamNode wam; - ros::NodeHandle n_("wam"); - wam_dof = dof.size(); - gravity_srv = n_.advertiseService("gravity_comp", &WamNode::gravity, &wam); - jmove_srv = n_.advertiseService("joint_move", &WamNode::joint_move, &wam); - cmove_srv = n_.advertiseService("cartesian_move", &WamNode::cart_move, &wam); - home_srv = n_.advertiseService("go_home",&WamNode::go_home, &wam); - joint_pub = n_.advertise("wam_joints", 100); - pose_pub = n_.advertise("wam_pose", 100); - - //explicitly naming joints until loaded from urdf - const char* strarray[] = {"j1", "j2", "j3", "j4", "j5", "j6", "j7"}; - std::vector joints(strarray, strarray + 7); - joint_state.name = joints; - joint_state.name.resize(wam_dof); - joint_state.position.resize(wam_dof); - joint_state.velocity.resize(wam_dof); - joint_state.effort.resize(wam_dof); - - if (wam_dof == 4) - { - *jp4home = wam4->getJointPositions(); - } - else if (wam_dof == 7) - { - *jp7home = wam7->getJointPositions(); - } - } - - ~WamNode(){} - - bool gravity(wam_node::GravityComp::Request &req, wam_node::GravityComp::Response &res); - bool joint_move(wam_node::JointMove::Request &req, wam_node::JointMove::Response &res); - bool cart_move(wam_node::CartMove::Request &req, wam_node::CartMove::Response &res); - bool go_home(std_srvs::Empty::Request &req, std_srvs::Empty::Response &res); - void update_publisher(std::vector &j_pos, std::vector &j_vel, std::vector &j_tor, - std::vector &c_pos); -}; - -bool WamNode::gravity(wam_node::GravityComp::Request &req, wam_node::GravityComp::Response &res) -{ - grav_state = req.gravity; - if (wam4 != NULL) - wam4->gravityCompensate(grav_state); - else if (wam7 != NULL) - wam7->gravityCompensate(grav_state); - - ROS_INFO("Gravity Compensation Request: %s", (req.gravity) ? "true" : "false"); - return true; -} - -bool WamNode::joint_move(wam_node::JointMove::Request &req, wam_node::JointMove::Response &res) -{ - if (req.joints.size() != (size_t)wam_dof) - { - ROS_INFO("Request Failed: %d-DOF request received, must be %d-DOF", req.joints.size(), wam_dof); - return false; - } - - if (wam_dof == 4) - { - for (int i = 0; i < 4; i++) - (*jp4)[i] = req.joints[i]; - wam4->moveTo(*jp4); - } - else - { - for (int j = 0; j < 7; j++) - (*jp7)[j] = req.joints[j]; - wam7->moveTo(*jp7); - } - ROS_INFO("Moving Robot to Commanded Joint Pose"); - return true; -} - -bool WamNode::cart_move(wam_node::CartMove::Request &req, wam_node::CartMove::Response &res) -{ - if (req.coordinates.size() != 3) - { - ROS_INFO("Request Failed: %d coordinate request received, must be 3 coordinates [X,Y,Z]", req.coordinates.size()); - return false; - } - for (int i = 0; i < 3; i++) - (*cpp)[i] = req.coordinates[i]; - - if (wam_dof == 4) - wam4->moveTo(*jp4); - else - wam7->moveTo(*jp7); - - ROS_INFO("Moving Robot to Commanded Coordinate Pose"); - return true; -} - -bool WamNode::go_home(std_srvs::Empty::Request &req, std_srvs::Empty::Response &res) -{ - if (wam_dof == 4) - { - wam4->moveTo(*jp4home); - } - else - { - wam7->moveTo(*jp7home); - } - ROS_INFO("Moving Robot to Starting Position"); - return true; -} - -void WamNode::update_publisher(std::vector &j_pos, std::vector &j_vel, std::vector &j_tor, - std::vector &c_pos) -{ - //publishing sensor_msgs/JointState to wam_joints - for (size_t i = 0; i < j_pos.size(); i++) - { - joint_state.position[i] = j_pos[i]; - joint_state.velocity[i] = j_vel[i]; - joint_state.effort[i] = j_tor[i]; - } - joint_pub.publish(joint_state); - - //publishing geometry_msgs/PoseStamed to wam_pose - wam_pose.pose.position.x = c_pos[0]; - wam_pose.pose.position.y = c_pos[1]; - wam_pose.pose.position.z = c_pos[2]; - wam_pose.pose.orientation.w = to.w(); - wam_pose.pose.orientation.x = to.x(); - wam_pose.pose.orientation.y = to.y(); - wam_pose.pose.orientation.z = to.z(); - pose_pub.publish(wam_pose); -} - -template - int wam_main(int argc, char** argv, ProductManager& pm, systems::Wam& wam) - { - BARRETT_UNITS_TEMPLATE_TYPEDEFS(DOF); - BARRETT_UNITS_FIXED_SIZE_TYPEDEFS; - wam.gravityCompensate(grav_state); - ros::init(argc, argv, "barrettWam"); - WamNode wam_node; - - if (pm.foundWam4()) - { - wam4 = pm.getWam4(); - } - else if (pm.foundWam7()) - wam7 = pm.getWam7(); - - jp_type jp; - jv_type jv; - jt_type jt; - cp_type cp; - - cpp = new units::CartesianPosition::type; - if (DOF == 4) - { - jp4 = new units::JointPositions<4>::type; - jp4home = new units::JointPositions<4>::type; - - } - else if (DOF == 7) - { - jp7 = new units::JointPositions<7>::type; - jp7home = new units::JointPositions<7>::type; - } - - std::vector joint_vel; - std::vector joint_tor; - std::vector joint_pos; - std::vector cart_pos; - joint_pos.resize(jp.size()); - joint_vel.resize(jv.size()); - joint_tor.resize(jt.size()); - cart_pos.resize(cp.size()); - - wam_node.init(joint_pos); - - int pub_rate = 1000000 * (1 / PUBLISH_FREQ); - while (ros::ok() && pm.getSafetyModule()->getMode() == SafetyModule::ACTIVE) - { - ros::spinOnce(); - jp = wam.getJointPositions(); - jt = wam.getJointTorques(); - jv = wam.getJointVelocities(); - cp = wam.getToolPosition(); - to = wam.getToolOrientation(); - for (size_t i = 0; i < DOF; i++) - { - joint_pos[i] = jp[i]; - joint_vel[i] = jv[i]; - joint_tor[i] = jt[i]; - if (i < 3) - cart_pos[i] = cp[i]; - } - wam_node.update_publisher(joint_pos, joint_vel, joint_tor, cart_pos); - usleep(pub_rate); // publishing at frequency PUBLISH_FREQ - } - delete cpp; - delete jp4; - delete jp4home; - delete jp7; - delete jp7home; - return 0; - } - diff --git a/wam_node/srv/CartMove.srv b/wam_node/srv/CartMove.srv deleted file mode 100644 index 369f58b..0000000 --- a/wam_node/srv/CartMove.srv +++ /dev/null @@ -1,2 +0,0 @@ -float32[] coordinates ---- \ No newline at end of file diff --git a/wam_node/srv/GravityComp.srv b/wam_node/srv/GravityComp.srv deleted file mode 100644 index 102ea81..0000000 --- a/wam_node/srv/GravityComp.srv +++ /dev/null @@ -1,2 +0,0 @@ -bool gravity ---- diff --git a/wam_node/srv/JointMove.srv b/wam_node/srv/JointMove.srv deleted file mode 100644 index 3292309..0000000 --- a/wam_node/srv/JointMove.srv +++ /dev/null @@ -1,2 +0,0 @@ -float32[] joints ---- \ No newline at end of file