34 #include <geometry_msgs/Twist.h> 35 #include <sensor_msgs/Joy.h> 36 #include <svenzva_msgs/GripperAction.h> 45 void joyCallback(
const sensor_msgs::Joy::ConstPtr& joy);
86 geometry_msgs::Twist twist;
103 if(joy->axes[2] < 0 || joy->axes[5] < 0){
107 svenzva_msgs::GripperGoal goal;
108 if(joy->axes[2] < 0){
109 goal.target_action = goal.CLOSE;
110 goal.target_current = 300;
112 else if(joy->axes[5] < 0){
113 goal.target_action = goal.OPEN;
126 int main(
int argc,
char** argv)
128 ros::init(argc, argv,
"svenzva_joystick_controller");
sensor_msgs::Joy last_cmd
bool waitForServer(const ros::Duration &timeout=ros::Duration(0, 0)) const
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)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
void joyCallback(const sensor_msgs::Joy::ConstPtr &joy)
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
void sendGoal(const Goal &goal, SimpleDoneCallback done_cb=SimpleDoneCallback(), SimpleActiveCallback active_cb=SimpleActiveCallback(), SimpleFeedbackCallback feedback_cb=SimpleFeedbackCallback())
ROSCPP_DECL void spinOnce()