34 #include <std_msgs/Int32.h> 35 #include <geometry_msgs/Twist.h> 36 #include <sensor_msgs/Joy.h> 37 #include <svenzva_msgs/GripperAction.h> 60 void joyCallback(
const sensor_msgs::Joy::ConstPtr& joy);
104 geometry_msgs::Twist twist;
105 std_msgs::Int32 mode_cmd;
106 mode_cmd.data =
mode;
125 int main(
int argc,
char** argv)
127 ros::init(argc, argv,
"svenzva_3axis_controller");
132 bool gripper_open =
true;
134 while(!svenzva_joy.
valid){
143 svenzva_joy.
mode += 1;
144 if (svenzva_joy.
mode > 2)
145 svenzva_joy.
mode = 0;
148 if(svenzva_joy.
mode == 2){
150 svenzva_msgs::GripperGoal goal;
152 int user_target_goal = 0;
154 user_target_goal = 1;
156 user_target_goal = -1;
159 if(user_target_goal < 0){
160 goal.target_action = goal.CLOSE;
161 goal.target_current = 200;
162 gripper_open =
false;
167 else if(user_target_goal > 0){
168 goal.target_action = goal.OPEN;
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())
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
void joyCallback(const sensor_msgs::Joy::ConstPtr &joy)
actionlib::SimpleActionClient< svenzva_msgs::GripperAction > gripperClient
int main(int argc, char **argv)
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
SimpleClientGoalState sendGoalAndWait(const Goal &goal, const ros::Duration &execute_timeout=ros::Duration(0, 0), const ros::Duration &preempt_timeout=ros::Duration(0, 0))
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
ROSCPP_DECL void spinOnce()