mia_hand_description
rel 1.0.0
|
Go to the documentation of this file.
2 #include "std_msgs/String.h"
3 #include "sensor_msgs/JointState.h"
7 #include <urdf/model.h>
8 #include <joint_limits_interface/joint_limits.h>
9 #include <joint_limits_interface/joint_limits_interface.h>
10 #include <joint_limits_interface/joint_limits_rosparam.h>
11 #include <joint_limits_interface/joint_limits_urdf.h>
29 pub =
n.advertise<sensor_msgs::JointState>(
"miaviz_joint_states", 1000);
32 const bool load =
true;
39 if (ros::param::has(
"~remap_MIA_th_opp"))
102 int nJoints = msg->name.size();
104 sensor_msgs::JointState sensor_msgs = *msg;
109 for(
unsigned int j=0; j < nJoints; j++)
111 const std::string jname = sensor_msgs.name[j];
114 if(j_index > -1 && j_th > -1) {
break;}
123 sensor_msgs.position[j_th] = th_fle_pos;
124 sensor_msgs.position[j_index] = std::abs(sensor_msgs.position[j_index]);
127 else if (j_index > -1 && (j_th == -1 ||
remap_th_opp ==
false))
129 sensor_msgs.position[j_index] = std::abs(sensor_msgs.position[j_index]);
132 pub.publish(sensor_msgs);
144 int main(
int argc,
char **argv)
147 ros::init(argc, argv,
"remap_mia_joint_states");
ros::Publisher pub
Publisher to publish remapped miajoint.
ros::Subscriber sub
Subscriber to publish listen to raw mia joint states.
double GetThumbOppPosition(double j_index_flex_pos)
Evaluate the position of the thumb opposition based on index flexion state.
std::string j_index_name
Name of the index flex joint as declared in the URDF.
ros::NodeHandle n
Ros node varibale.
int main(int argc, char **argv)
Main of the ROS node using the Remap class.
void chattercallback(const sensor_msgs::JointState::ConstPtr &msg)
Callback of the subscriber.
std::string j_thumb_name
Name of the thumb_opp joint specified in the URDF.
thumb_opp_passive_joints class.
void init(const bool LoadURDFInfo_=false)
Initialize class.
std::string robot_description_
Name of parameter link to the URDF.
std::string j_thumb_name
Name of the thumb opp joint as declared in the URDF.
Class to remap Mia JointState.
mia_hand::thumb_opp_passive_joint MyTh_opp_passiveJoint
Class describing the thumb_opp and index flex passive joint.
std::string robot_description_
Name of parameter describing the robot description loaded in the ROS parameter server.
bool remap_th_opp
Bool True to remap also the thumb opp position.
std::string j_index_name
Name of the index_fle joint specified in the URDF.