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->buttons[4] + msg->buttons[5];
36 twist.twist.linear.y = msg->axes[0];
37 twist.twist.linear.z = msg->axes[1];
38 twist.twist.angular.x = -msg->axes[3];
39 twist.twist.angular.y = msg->axes[4];
41 twist.twist.angular.z = -msg->buttons[0] + msg->buttons[1];
44 jog_msgs::JogJoint joint_deltas;
46 joint_deltas.joint_names.push_back(
"joint_s");
49 joint_deltas.deltas.push_back(msg->buttons[6] - msg->buttons[7]);
53 joint_delta_pub_.
publish(joint_deltas);
58 int main(
int argc,
char** argv)
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())
void joyCallback(const sensor_msgs::Joy::ConstPtr &msg)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
ros::Publisher joint_delta_pub_
int main(int argc, char **argv)
ros::Publisher twist_pub_
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
ros::AsyncSpinner spinner_
ROSCPP_DECL void waitForShutdown()