summit_xl_pad.cpp
Go to the documentation of this file.
1 /*
2  * summit_xl_pad
3  * Copyright (c) 2012, Robotnik Automation, SLL
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  * * Neither the name of the Robotnik Automation, SLL. nor the names of its
15  * contributors may be used to endorse or promote products derived from
16  * this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28  * POSSIBILITY OF SUCH DAMAGE.
29  *
30  * \author Robotnik Automation, SLL
31  * \brief Allows to use a pad with the roboy controller, sending the messages received from the joystick device
32  */
33 
34 
35 #include <ros/ros.h>
36 #include <sensor_msgs/Joy.h>
37 #include <geometry_msgs/Twist.h>
38 #include <robotnik_msgs/ptz.h>
39 // Not yet catkinized 9/2013
40 // #include <sound_play/sound_play.h>
41 #include <unistd.h>
42 #include <robotnik_msgs/set_mode.h>
43 #include <robotnik_msgs/set_digital_output.h>
44 #include <std_srvs/SetBool.h>
45 #include <robotnik_msgs/ptz.h>
46 #include <robotnik_msgs/home.h>
49 
50 #define DEFAULT_NUM_OF_BUTTONS 16
51 #define DEFAULT_AXIS_LINEAR_X 1
52 #define DEFAULT_AXIS_LINEAR_Y 0
53 #define DEFAULT_AXIS_ANGULAR 2
54 #define DEFAULT_AXIS_LINEAR_Z 3
55 #define DEFAULT_SCALE_LINEAR 1.0
56 #define DEFAULT_SCALE_ANGULAR 2.0
57 #define DEFAULT_SCALE_LINEAR_Z 1.0
58 
59 #define ITERATIONS_WRITE_MODBUS 2
60 
61 //Used only with ps4
62 #define AXIS_PTZ_TILT_UP 0
63 #define AXIS_PTZ_TILT_DOWN 1
64 #define AXIS_PTZ_PAN_LEFT 2
65 #define AXIS_PTZ_PAN_RIGHT 3
66 
67 
69 // NOTE: //
70 // This configuration is made for a THRUSTMASTER T-Wireless 3in1 Joy //
71 // please feel free to modify to adapt for your own joystick. //
72 // //
73 
74 
76 {
77  public:
78  SummitXLPad();
79  void Update();
80 
81  private:
82  void padCallback(const sensor_msgs::Joy::ConstPtr& joy);
83  int setBumperOverride(bool value);
84  int setManualRelease(bool value);
87 
96  std::string cmd_topic_vel_;
98  std::string cmd_service_io_;
100  std::string cmd_topic_ptz_;
101  double current_vel;
103  std::string pad_type_;
118  std::string cmd_set_mode_;
124  std::string cmd_home_;
138 
139  // DIAGNOSTICS
151  bool bEnable;
155  // sound_play::SoundClient sc;
161  std::string joystick_dead_zone_;
164 };
165 
166 
168  linear_x_(1),
169  linear_y_(0),
170  angular_(2),
171  linear_z_(3),
172  pnh_("~")
173 {
174  current_vel = 0.1;
175 
176  //JOYSTICK PAD TYPE
177  pnh_.param<std::string>("pad_type",pad_type_,"ps3");
178  //
179  pnh_.param("num_of_buttons", num_of_buttons_, DEFAULT_NUM_OF_BUTTONS);
180  // MOTION CONF
181  pnh_.param("axis_linear_x", linear_x_, DEFAULT_AXIS_LINEAR_X);
182  pnh_.param("axis_linear_y", linear_y_, DEFAULT_AXIS_LINEAR_Y);
183  pnh_.param("axis_linear_z", linear_z_, DEFAULT_AXIS_LINEAR_Z);
184  pnh_.param("axis_angular", angular_, DEFAULT_AXIS_ANGULAR);
185  pnh_.param("scale_angular", a_scale_, DEFAULT_SCALE_ANGULAR);
186  pnh_.param("scale_linear", l_scale_, DEFAULT_SCALE_LINEAR);
187  pnh_.param("scale_linear_z", l_scale_z_, DEFAULT_SCALE_LINEAR_Z);
188  pnh_.param("cmd_topic_vel", cmd_topic_vel_, cmd_topic_vel_);
189  pnh_.param("button_dead_man", dead_man_button_, dead_man_button_);
190  pnh_.param("button_bumber_override", bumper_override_button_, bumper_override_button_);
191  pnh_.param("button_speed_up", speed_up_button_, speed_up_button_); //4 Thrustmaster
192  pnh_.param("button_speed_down", speed_down_button_, speed_down_button_); //5 Thrustmaster
193  pnh_.param<std::string>("joystick_dead_zone", joystick_dead_zone_, "true");
194 
195  // DIGITAL OUTPUTS CONF
196  pnh_.param("cmd_service_io", cmd_service_io_, cmd_service_io_);
197  pnh_.param("button_output_1", button_output_1_, button_output_1_);
198  pnh_.param("button_output_2", button_output_2_, button_output_2_);
199  pnh_.param("output_1", output_1_, output_1_);
200  pnh_.param("output_2", output_2_, output_2_);
201  // PANTILT-ZOOM CONF
202  pnh_.param("cmd_topic_ptz", cmd_topic_ptz_, cmd_topic_ptz_);
203  pnh_.param("button_ptz_tilt_up", ptz_tilt_up_, ptz_tilt_up_);
204  pnh_.param("button_ptz_tilt_down", ptz_tilt_down_, ptz_tilt_down_);
205  pnh_.param("button_ptz_pan_right", ptz_pan_right_, ptz_pan_right_);
206  pnh_.param("button_ptz_pan_left", ptz_pan_left_, ptz_pan_left_);
207  pnh_.param("button_ptz_zoom_wide", ptz_zoom_wide_, ptz_zoom_wide_);
208  pnh_.param("button_ptz_zoom_tele", ptz_zoom_tele_, ptz_zoom_tele_);
209  pnh_.param("button_home", button_home_, button_home_);
210  pnh_.param("pan_increment", pan_increment_, 0.09);
211  pnh_.param("tilt_increment", tilt_increment_, 0.09);
212  pnh_.param("zoom_increment", zoom_increment_, 200);
213 
214  // KINEMATIC MODE
215  pnh_.param("button_kinematic_mode", button_kinematic_mode_, button_kinematic_mode_);
216  pnh_.param("cmd_service_set_mode", cmd_set_mode_, cmd_set_mode_);
217  pnh_.param("cmd_service_home", cmd_home_, std::string("home"));
218  kinematic_mode_ = 1;
219 
220  ROS_INFO("SummitXLPad num_of_buttons_ = %d, zoom = %d, %d", num_of_buttons_, ptz_zoom_wide_, ptz_zoom_tele_);
221  for(int i = 0; i < num_of_buttons_; i++){
222  bRegisteredButtonEvent[i] = false;
223  ROS_INFO("bREG %d", i);
224  }
225 
226  for(int i = 0; i < 3; i++){
227  bRegisteredDirectionalArrows[i] = false;
228  }
229 
230  /*ROS_INFO("Service I/O = [%s]", cmd_service_io_.c_str());
231  ROS_INFO("Topic PTZ = [%s]", cmd_topic_ptz_.c_str());
232  ROS_INFO("Service I/O = [%s]", cmd_topic_vel_.c_str());
233  ROS_INFO("Axis linear = %d", linear_);
234  ROS_INFO("Axis angular = %d", angular_);
235  ROS_INFO("Scale angular = %d", a_scale_);
236  ROS_INFO("Deadman button = %d", dead_man_button_);
237  ROS_INFO("OUTPUT1 button %d", button_output_1_);
238  ROS_INFO("OUTPUT2 button %d", button_output_2_);
239  ROS_INFO("OUTPUT1 button %d", button_output_1_);
240  ROS_INFO("OUTPUT2 button %d", button_output_2_);*/
241 
242  // Publish through the node handle Twist type messages to the guardian_controller/command topic
243  vel_pub_ = nh_.advertise<geometry_msgs::Twist>(cmd_topic_vel_, 1);
244  // Publishes msgs for the pant-tilt cam
245  ptz_pub_ = nh_.advertise<robotnik_msgs::ptz>(cmd_topic_ptz_, 1);
246 
247  // Listen through the node handle sensor_msgs::Joy messages from joystick
248  // (these are the references that we will sent to summit_xl_controller/command)
249  pad_sub_ = nh_.subscribe<sensor_msgs::Joy>("joy", 10, &SummitXLPad::padCallback, this);
250 
251  // Request service to activate / deactivate digital I/O
252  set_digital_outputs_client_ = nh_.serviceClient<robotnik_msgs::set_digital_output>(cmd_service_io_);
253  set_manual_release_client_ = nh_.serviceClient<std_srvs::SetBool>("safety_module/set_manual_release");
254  set_bumper_override_client_ = nh_.serviceClient<std_srvs::SetBool>("safety_module/set_bumper_override");
255  bOutput1 = bOutput2 = false;
256 
257  // Request service to set kinematic mode
258  setKinematicMode = nh_.serviceClient<robotnik_msgs::set_mode>(cmd_set_mode_);
259 
264 
265  // Request service to start homing
266  doHome = nh_.serviceClient<robotnik_msgs::home>(cmd_home_);
267 
268  // Diagnostics
269  updater_pad.setHardwareID("None");
270  // Topics freq control
275 
278 
279 
280  bEnable = false; // Communication flag disabled by default
281  last_command_ = true;
282  if(pad_type_=="ps4" || pad_type_=="logitechf710")
283  ptz_control_by_axes_ = true;
284  else
285  ptz_control_by_axes_ = false;
286 }
287 
288 
289 /*
290  * \brief Updates the diagnostic component. Diagnostics
291  *
292  */
295 }
296 
297 
298 
299 void SummitXLPad::padCallback(const sensor_msgs::Joy::ConstPtr& joy)
300 {
301  geometry_msgs::Twist vel;
302  robotnik_msgs::ptz ptz;
303  bool ptzEvent = false;
304 
305  vel.linear.x = 0.0;
306  vel.linear.y = 0.0;
307  vel.linear.z = 0.0;
308 
309  vel.angular.x = 0.0;
310  vel.angular.y = 0.0;
311  vel.angular.z = 0.0;
312 
313  bEnable = (joy->buttons[dead_man_button_] == 1);
314 
315  // Actions dependant on dead-man button
316  if (joy->buttons[dead_man_button_] == 1) {
317  //ROS_ERROR("SummitXLPad::padCallback: DEADMAN button %d", dead_man_button_);
318  //Set the current velocity level
319 
320  // Safety module management
322  // MANUAL RELEASE -> 1
323  // write the signal X number of times
325  setManualRelease(true);
327  }
328 
329  // L1 pressed -> Bumper override 1
330  if(joy->buttons[bumper_override_button_] == 1){
332  setBumperOverride(true);
334  }
336  }else{
338  setBumperOverride(false);
340  }
342  }
343 
344  if ( joy->buttons[speed_down_button_] == 1 ){
345 
347  if(current_vel > 0.1){
348  current_vel = current_vel - 0.1;
350  ROS_INFO("Velocity: %f%%", current_vel*100.0);
351  char buf[50]="\0";
352  int percent = (int) (current_vel*100.0);
353  sprintf(buf," %d percent", percent);
354  // sc.say(buf);
355  }
356  }else{
358  }
359  //ROS_ERROR("SummitXLPad::padCallback: Passed SPEED DOWN button %d", speed_down_button_);
360  if (joy->buttons[speed_up_button_] == 1){
362  if(current_vel < 0.9){
363  current_vel = current_vel + 0.1;
365  ROS_INFO("Velocity: %f%%", current_vel*100.0);
366  char buf[50]="\0";
367  int percent = (int) (current_vel*100.0);
368  sprintf(buf," %d percent", percent);
369  // sc.say(buf);
370  }
371 
372  }else{
374  }
375  //ROS_ERROR("SummitXLPad::padCallback: Passed SPEED UP button %d", speed_up_button_);
376 
377 
378 
379  vel.linear.x = current_vel*l_scale_*joy->axes[linear_x_];
380  if (kinematic_mode_ == 2) vel.linear.y = current_vel*l_scale_*joy->axes[linear_y_];
381  else vel.linear.y = 0.0;
382 
383  //ROS_ERROR("SummitXLPad::padCallback: Passed linear axes");
384 
385  if(joystick_dead_zone_=="true")
386  {
387  // limit scissor movement or robot turning (they are in the same joystick)
388  if(joy->axes[angular_] == 1.0 || joy->axes[angular_] == -1.0) // if robot turning
389  {
390  // Same angular velocity for the three axis
391  vel.angular.x = current_vel*(a_scale_*joy->axes[angular_]);
392  vel.angular.y = current_vel*(a_scale_*joy->axes[angular_]);
393  vel.angular.z = current_vel*(a_scale_*joy->axes[angular_]);
394 
395  vel.linear.z = 0.0;
396  }
397  else if (joy->axes[linear_z_] == 1.0 || joy->axes[linear_z_] == -1.0) // if scissor moving
398  {
399  vel.linear.z = current_vel*l_scale_z_*joy->axes[linear_z_]; // scissor movement
400 
401  // limit robot turn
402  vel.angular.x = 0.0;
403  vel.angular.y = 0.0;
404  vel.angular.z = 0.0;
405  }
406  else
407  {
408  // Same angular velocity for the three axis
409  vel.angular.x = current_vel*(a_scale_*joy->axes[angular_]);
410  vel.angular.y = current_vel*(a_scale_*joy->axes[angular_]);
411  vel.angular.z = current_vel*(a_scale_*joy->axes[angular_]);
412  vel.linear.z = current_vel*l_scale_z_*joy->axes[linear_z_]; // scissor movement
413  }
414  }
415  else // no dead zone
416  {
417  vel.angular.x = current_vel*(a_scale_*joy->axes[angular_]);
418  vel.angular.y = current_vel*(a_scale_*joy->axes[angular_]);
419  vel.angular.z = current_vel*(a_scale_*joy->axes[angular_]);
420  vel.linear.z = current_vel*l_scale_z_*joy->axes[linear_z_];
421  }
422 
423  //ROS_ERROR("SummitXLPad::padCallback: Passed joystick deadzone ifelse");
424 
425 
426 
427  // LIGHTS
428  if (joy->buttons[button_output_1_] == 1) {
429 
431  //ROS_INFO("SummitXLPad::padCallback: OUTPUT1 button %d", button_output_1_);
432  robotnik_msgs::set_digital_output write_do_srv;
433  write_do_srv.request.output = output_1_;
435  write_do_srv.request.value = bOutput1;
436  if(bEnable){
437  set_digital_outputs_client_.call( write_do_srv );
439  }
440  }
441  }else{
443  }
444 
445  if (joy->buttons[button_output_2_] == 1) {
446 
448  //ROS_INFO("SummitXLPad::padCallback: OUTPUT2 button %d", button_output_2_);
449  robotnik_msgs::set_digital_output write_do_srv;
450  write_do_srv.request.output = output_2_;
452  write_do_srv.request.value = bOutput2;
453 
454  if(bEnable){
455  set_digital_outputs_client_.call( write_do_srv );
457  }
458  }
459  }else{
461  }
462 
463  //ROS_ERROR("SummitXLPad::padCallback: Passed LIGHTS");
464 
465  // HOMING SERVICE
466  if (joy->buttons[button_home_] == 1) {
468  robotnik_msgs::home home_srv;
469  home_srv.request.request = true;
470  if (bEnable) {
471  ROS_INFO("SummitXLPad::padCallback - Home");
472  doHome.call( home_srv );
474  }
475  }
476  // Use this button also to block robot motion while moving the scissor
477  vel.angular.x = 0.0;
478  vel.angular.y = 0.0;
479  vel.angular.z = 0.0;
480  vel.linear.x = 0.0;
481  vel.linear.y = 0.0;
482  }
483  else {
485  }
486 
487  //ROS_ERROR("SummitXLPad::padCallback: Passed HOME BUTTON");
488 
489  // PTZ
490  ptz.pan = ptz.tilt = ptz.zoom = 0.0;
491  ptz.relative = true;
492 
494  {
495  if (joy->axes[ptz_tilt_up_] == -1.0) {
497  ptz.tilt = tilt_increment_;
498  //ROS_INFO("SummitXLPad::padCallback: TILT UP");
500  ptzEvent = true;
501  }
502  }else{
504  }
505  if (joy->axes[ptz_tilt_down_] == 1.0) {
507  ptz.tilt = -tilt_increment_;
508  //ROS_INFO("SummitXLPad::padCallback: TILT DOWN");
510  ptzEvent = true;
511  }
512  }else{
514  }
515  if (joy->axes[ptz_pan_left_] == -1.0) {
517  ptz.pan = -pan_increment_;
518  //ROS_INFO("SummitXLPad::padCallback: PAN LEFT");
520  ptzEvent = true;
521  }
522  }else{
524  }
525  if (joy->axes[ptz_pan_right_] == 1.0) {
527  ptz.pan = pan_increment_;
528  //ROS_INFO("SummitXLPad::padCallback: PAN RIGHT");
530  ptzEvent = true;
531  }
532  }else{
534  }
535 
536  }else{
537  //ROS_ERROR("SummitXLPad::padCallback: INSIDE ELSE PTZ PAD_TYPE");
538  // TILT-MOVEMENTS (RELATIVE POS)
539  if (joy->buttons[ptz_tilt_up_] == 1) {
541  ptz.tilt = tilt_increment_;
542  //ROS_INFO("SummitXLPad::padCallback: TILT UP");
544  ptzEvent = true;
545  }
546  }else {
548  }
549 
550  if (joy->buttons[ptz_tilt_down_] == 1) {
552  ptz.tilt = -tilt_increment_;
553  //ROS_INFO("SummitXLPad::padCallback: TILT DOWN");
555  ptzEvent = true;
556  }
557  }else{
559  }
560 
561  // PAN-MOVEMENTS (RELATIVE POS)
562  if (joy->buttons[ptz_pan_left_] == 1) {
564  ptz.pan = -pan_increment_;
565  //ROS_INFO("SummitXLPad::padCallback: PAN LEFT");
567  ptzEvent = true;
568  }
569  }else{
571  }
572 
573  if (joy->buttons[ptz_pan_right_] == 1) {
575  ptz.pan = pan_increment_;
576  //ROS_INFO("SummitXLPad::padCallback: PAN RIGHT");
578  ptzEvent = true;
579  }
580  }else{
582  }
583  }
584 
585  // ZOOM Settings (RELATIVE)
586  if (joy->buttons[ptz_zoom_wide_] == 1) {
588  ptz.zoom = -zoom_increment_;
589  //ROS_INFO("SummitXLPad::padCallback: ZOOM WIDe");
591  ptzEvent = true;
592  }
593  }else{
595  }
596 
597  if (joy->buttons[ptz_zoom_tele_] == 1) {
599  ptz.zoom = zoom_increment_;
600  //ROS_INFO("SummitXLPad::padCallback: ZOOM TELE");
602  ptzEvent = true;
603  }
604  }else{
606  }
607 
608  if (joy->buttons[button_kinematic_mode_] == 1) {
609 
611  // Define mode (inc) - still coupled
612  kinematic_mode_ += 1;
613  if (kinematic_mode_ > 2) kinematic_mode_ = 1;
614  ROS_INFO("SummitXLJoy::joyCallback: Kinematic Mode %d ", kinematic_mode_);
615  // Call service
616  robotnik_msgs::set_mode set_mode_srv;
617  set_mode_srv.request.mode = kinematic_mode_;
618  setKinematicMode.call( set_mode_srv );
620  }
621  }else{
623  }
624 
625  //ROS_ERROR("SummitXLPad::padCallback: Passed SPHERE CAM and KINEMATIC MODE");
626 
627  }
628  else {
629 
630  // Safety module management
631  // MANUAL RELEASE -> 0
633  setManualRelease(false);
635  }
636 
638  setBumperOverride(false);
640  }
641 
644 
645 
646  vel.angular.x = 0.0; vel.angular.y = 0.0; vel.angular.z = 0.0;
647  vel.linear.x = 0.0; vel.linear.y = 0.0; vel.linear.z = 0.0;
648  }
649 
650  sus_joy_freq->tick(); // Ticks the reception of joy events
651 
652  // Publish
653  // Only publishes if it's enabled
654  if(bEnable){
655  if (ptzEvent) ptz_pub_.publish(ptz);
656  vel_pub_.publish(vel);
658  last_command_ = true;
659  }
660 
661 
662  if(!bEnable && last_command_){
663  if (ptzEvent) ptz_pub_.publish(ptz);
664 
665  vel.angular.x = 0.0; vel.angular.y = 0.0; vel.angular.z = 0.0;
666  vel.linear.x = 0.0; vel.linear.y = 0.0; vel.linear.z = 0.0;
667  vel_pub_.publish(vel);
669  last_command_ = false;
670  }
671 }
672 
674  std_srvs::SetBool set_bool_msg;
675 
676  set_bool_msg.request.data = value;
677  set_manual_release_client_.call(set_bool_msg);
678 
679  return 0;
680 }
681 
683  std_srvs::SetBool set_bool_msg;
684 
685  set_bool_msg.request.data = value;
686  set_bumper_override_client_.call(set_bool_msg);
687 
688  return 0;
689 }
690 
691 int main(int argc, char** argv)
692 {
693  ros::init(argc, argv, "summit_xl_pad");
694  SummitXLPad summit_xl_pad;
695 
696  ros::Rate r(50.0);
697 
698  while( ros::ok() ){
699  // UPDATING DIAGNOSTICS
700  summit_xl_pad.Update();
701  ros::spinOnce();
702  r.sleep();
703  }
704 }
705 
ServiceClient serviceClient(const std::string &service_name, bool persistent=false, const M_string &header_values=M_string())
diagnostic_updater::HeaderlessTopicDiagnostic * sus_joy_freq
Diagnostic to control the reception frequency of the subscribed joy topic.
ros::ServiceClient doHome
Service to start homing.
#define AXIS_PTZ_PAN_RIGHT
int setManualRelease(bool value)
#define DEFAULT_SCALE_ANGULAR
bool bEnable
Flag to enable/disable the communication with the publishers topics.
ros::NodeHandle pnh_
std::string cmd_topic_vel_
Name of the topic where it will be publishing the velocity.
int manual_release_false_number_
int speed_up_button_
Number of the button for increase or decrease the speed max of the joystick.
#define DEFAULT_AXIS_ANGULAR
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 button_kinematic_mode_
button to change kinematic mode
int ptz_tilt_up_
buttons to the pan-tilt-zoom camera
int bumper_override_false_number_
std::string cmd_topic_ptz_
Name of the topic where it will be publishing the pant-tilt values.
void setHardwareID(const std::string &hwid)
double tilt_increment_
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
bool call(MReq &req, MRes &res)
#define DEFAULT_AXIS_LINEAR_Z
#define DEFAULT_NUM_OF_BUTTONS
double pan_increment_
Client of the sound play service.
int kinematic_mode_
kinematic mode
int button_home_
button to start the homing service
int bumper_override_button_
bool last_command_
Flag to track the first reading without the deadman&#39;s button pressed.
ros::Publisher vel_pub_
It will publish into command velocity (for the robot) and the ptz_state (for the pantilt) ...
double current_vel
std::string cmd_home_
Name of the service to do the homing.
int num_of_buttons_
Number of buttons of the joystick.
int zoom_increment_
Zoom increment (steps)
int bumper_override_true_number_
diagnostic_updater::HeaderlessTopicDiagnostic * pub_command_freq
Diagnostic to control the frequency of the published command velocity topic.
#define DEFAULT_AXIS_LINEAR_X
#define AXIS_PTZ_PAN_LEFT
#define ROS_INFO(...)
double l_scale_z_
#define ITERATIONS_WRITE_MODBUS
bool param(const std::string &param_name, T &param_val, const T &default_val) const
ROSCPP_DECL bool ok()
double min_freq_command
Diagnostics min freq.
#define AXIS_PTZ_TILT_UP
bool bRegisteredButtonEvent[DEFAULT_NUM_OF_BUTTONS]
Pointer to a vector for controlling the event when pushing the buttons.
bool ptz_control_by_axes_
Flag to enable the ptz control via axes.
double max_freq_command
Diagnostics max freq.
void padCallback(const sensor_msgs::Joy::ConstPtr &joy)
double min_freq_joy
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
ros::Publisher ptz_pub_
int main(int argc, char **argv)
ros::ServiceClient set_bumper_override_client_
int manual_release_true_number_
bool sleep()
int dead_man_button_
Number of the DEADMAN button.
int setBumperOverride(bool value)
bool bRegisteredDirectionalArrows[4]
Pointer to a vector for controlling the event when pushing directional arrows (UNDER AXES ON PX4!) ...
#define AXIS_PTZ_TILT_DOWN
diagnostic_updater::Updater updater_pad
General status diagnostic updater.
ros::Subscriber pad_sub_
It will be suscribed to the joystick.
std::string cmd_set_mode_
Name of the service to change the mode.
ros::NodeHandle nh_
#define DEFAULT_AXIS_LINEAR_Y
#define DEFAULT_SCALE_LINEAR_Z
std::string joystick_dead_zone_
Add a dead zone to the joystick that controls scissor and robot rotation (only useful for xWam) ...
double max_freq_joy
std::string cmd_service_io_
Name of the service where it will be modifying the digital outputs.
ROSCPP_DECL void spinOnce()
ros::ServiceClient set_manual_release_client_
Service to safety module.
std::string pad_type_
Pad type.
#define DEFAULT_SCALE_LINEAR
ros::ServiceClient set_digital_outputs_client_
Service to modify the digital outputs.
ros::ServiceClient setKinematicMode
Service to modify the kinematic mode.


summit_xl_pad
Author(s):
autogenerated on Tue Apr 27 2021 03:07:13