19 #include "asr_msgs/AsrGlove.h" 20 #include "asr_msgs/AsrObject.h" 21 #include <sensor_msgs/JointState.h> 36 void callback(
const asr_msgs::AsrGloveConstPtr& msg)
69 joint_state.position[21] = msg->data[21] * (-1) + 0.1;
80 if (msg->identifier ==
"tracker_right")
84 if(!msg->sampledPoses.size())
86 std::cerr <<
"Got a AsrObject without poses." << std::endl;
90 geometry_msgs::Pose current_pose = msg->sampledPoses.front().pose;
91 geometry_msgs::Point position = current_pose.position;
93 odom_trans.transform.translation.x = position.x;
94 odom_trans.transform.translation.y = position.y;
95 odom_trans.transform.translation.z = position.z;
96 odom_trans.transform.rotation = current_pose.orientation;
102 int main(
int argc,
char **argv)
108 pub_states = node.
advertise<sensor_msgs::JointState>(
"joint_states", 1);
void publish(const boost::shared_ptr< M > &message) const
sensor_msgs::JointState joint_state
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
ROSCPP_DECL void spin(Spinner &spinner)
ros::Subscriber sub_states
int main(int argc, char **argv)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
ros::Publisher pub_states
tf::TransformBroadcaster * pub_tf
void callback(const asr_msgs::AsrGloveConstPtr &msg)
geometry_msgs::TransformStamped odom_trans
void callback_tf(const asr_msgs::AsrObjectConstPtr &msg)