1 #ifndef WAM_CONTROLLER_H
2 #define WAM_CONTROLLER_H
6 #include "sensor_msgs/JointState.h"
7 #include "geometry_msgs/PoseStamped.h"
13 #include <std_srvs/Empty.h>
14 #include "wam_srvs/BHandSpreadPos.h"
15 #include "wam_srvs/BHandGraspPos.h"
16 #include "wam_srvs/BHandPinchPos.h"
17 #include "wam_srvs/BHandFingerPos.h"
20 #include "wam_srvs/Play.h"
21 #include "wam_srvs/Hold.h"
22 #include "wam_srvs/JointMove.h"
25 #include "wam_msgs/RTJointPos.h"
41 bool finger_pos(
double f1,
double f2,
double f3);
49 bool joint_move(
const Eigen::VectorXd& target_jnt_state);
62 return last_jnt_state.position.size();
73 Eigen::VectorXd
map_joints(
const Eigen::VectorXd& delta);
77 ros::ServiceClient initialize_srvs;
78 ros::ServiceClient close_grasp_srvs;
79 ros::ServiceClient open_grasp_srvs;
80 ros::ServiceClient open_spread_srvs;
81 ros::ServiceClient close_spread_srvs;
82 ros::ServiceClient grasp_pos_srvs;
83 ros::ServiceClient spread_pos_srvs;
84 ros::ServiceClient pinch_pos_srvs;
85 ros::ServiceClient finger_pos_srvs;
88 ros::ServiceClient play_srvs;
89 ros::ServiceClient joint_move_srvs;
90 ros::ServiceClient hold_jnt_srvs;
91 ros::Publisher jnt_rt_pub;
93 ros::Subscriber pose_sub;
94 ros::Subscriber jnt_sub;
96 geometry_msgs::PoseStamped last_pose;
97 sensor_msgs::JointState last_jnt_state;
99 std::vector<int> mapping{0,1,3};
101 template <
size_t DOF>
102 Eigen::VectorXd _get_jnt_state();
104 template <
size_t DOF>
105 Eigen::VectorXd _map_joints(
const Eigen::VectorXd& delta);
107 void pose_cb(geometry_msgs::PoseStampedConstPtr pose) {
111 void jnt_state_cb(sensor_msgs::JointStateConstPtr state) {
112 last_jnt_state = *state;
117 #endif // WAM_CONTROLLER_H
bool joint_move(const Eigen::VectorXd &target_jnt_state)
Definition: wam_controller.cpp:117
bool initialize()
Definition: wam_controller.cpp:31
bool open_grasp()
Definition: wam_controller.cpp:41
bool close_grasp()
Definition: wam_controller.cpp:36
geometry_msgs::PoseStamped get_pose()
Definition: wam_controller.h:54
Definition: robot_controller.h:6
bool spread_pos(double radians)
Definition: wam_controller.cpp:62
bool reset()
Definition: wam_controller.cpp:82
bool open_spread()
Definition: wam_controller.cpp:46
Eigen::VectorXd get_used_jnt_state()
Definition: wam_controller.cpp:205
bool set_2_finger_grasp()
Definition: wam_controller.cpp:88
bool finger_pos(double f1, double f2, double f3)
Definition: wam_controller.cpp:74
Eigen::VectorXd get_jnt_state()
Definition: wam_controller.cpp:179
bool rt_delta_move(const Eigen::VectorXd &delta)
Definition: wam_controller.cpp:135
void set_used_joints(std::string)
Definition: wam_controller.cpp:244
bool hold_joints(bool hold_joints)
Definition: wam_controller.cpp:111
bool move_to_initial_position()
Definition: wam_controller.cpp:165
bool delta_move(const Eigen::VectorXd &delta)
Definition: wam_controller.cpp:126
WamController(std::string robot_ns, ros::NodeHandle nh)
Definition: wam_controller.cpp:6
void set_target_joint_pose(Eigen::VectorXd target)
Definition: wam_controller.cpp:260
bool grasp_pos(double radians)
Definition: wam_controller.cpp:56
Eigen::VectorXd map_joints(const Eigen::VectorXd &delta)
Definition: wam_controller.cpp:214
bool play_motion(std::string motion)
Definition: wam_controller.cpp:105
bool set_3_finger_grasp()
Definition: wam_controller.cpp:97
size_t get_dof()
Definition: wam_controller.h:61
std::vector< int > get_used_joints()
Definition: wam_controller.h:65
Definition: wam_controller.h:27
bool close_spread()
Definition: wam_controller.cpp:51
bool pinch_pos(double radians)
Definition: wam_controller.cpp:68
double max_rate
Definition: wam_controller.h:29