1 #include "geometry_msgs/TwistStamped.h" 2 #include "jog_msgs/JogJoint.h" 4 #include "sensor_msgs/Joy.h" 31 geometry_msgs::TwistStamped twist;
34 twist.twist.linear.x = -msg->axes[0];
35 twist.twist.linear.y = msg->axes[1];
36 twist.twist.linear.z = msg->axes[4];
39 twist.twist.angular.x = -msg->axes[5];
40 twist.twist.angular.y = msg->axes[6];
42 twist.twist.angular.z = -msg->buttons[6] + msg->buttons[4];
45 jog_msgs::JogJoint joint_deltas;
48 joint_deltas.joint_names.push_back(
"femur_joint_r1");
49 joint_deltas.deltas.push_back(msg->buttons[5] - msg->buttons[7]);
53 joint_delta_pub_.
publish(joint_deltas);
58 int main(
int argc,
char** argv)
60 ros::init(argc, argv,
"dragonrise_to_twist");
void publish(const boost::shared_ptr< M > &message) const
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
int main(int argc, char **argv)
ros::Publisher joint_delta_pub_
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
ros::AsyncSpinner spinner_
ros::Publisher twist_pub_
void joyCallback(const sensor_msgs::Joy::ConstPtr &msg)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
ROSCPP_DECL void waitForShutdown()