JoystickDemo.h
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2015-2018, Dataspeed Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of Dataspeed Inc. nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *********************************************************************/
34 
35 #ifndef JOYSTICKDEMO_H_
36 #define JOYSTICKDEMO_H_
37 
38 #include <ros/ros.h>
39 #include <sensor_msgs/Joy.h>
40 #include <std_msgs/Empty.h>
41 
42 #include <dbw_pacifica_msgs/AcceleratorPedalCmd.h>
43 #include <dbw_pacifica_msgs/BrakeCmd.h>
44 #include <dbw_pacifica_msgs/SteeringCmd.h>
45 #include <dbw_pacifica_msgs/GearCmd.h>
46 #include <dbw_pacifica_msgs/MiscCmd.h>
47 #include <dbw_pacifica_msgs/GlobalEnableCmd.h>
48 
49 namespace joystick_demo
50 {
51 
52 typedef struct {
54  float brake_joy;
56  float steering_joy;
58  int gear_cmd;
64 
65 class JoystickDemo {
66 public:
68 private:
69  void recvJoy(const sensor_msgs::Joy::ConstPtr& msg);
70  void cmdCallback(const ros::TimerEvent& event);
71 
72  // Topics
82  // Parameters
83  bool ignore_; // Ignore driver overrides
84  bool enable_; // Use enable and disable buttons
85  bool count_; // Increment counter to enable watchdog
86  double svel_; // Steering command speed
87 
88  // Variables
91  sensor_msgs::Joy joy_;
92  uint8_t counter_;
93 
94  enum {
95  BTN_PARK = 3,
98  BTN_DRIVE = 0,
103  BTN_COUNT = 11,
110  };
111 };
112 
113 }
114 
115 #endif /* JOYSTICKDEMO_H_ */
msg
ros::Publisher pub_enable_
Definition: JoystickDemo.h:79
JoystickDemo(ros::NodeHandle &node, ros::NodeHandle &priv_nh)
ros::Publisher pub_global_enable_
Definition: JoystickDemo.h:81
JoystickDataStruct data_
Definition: JoystickDemo.h:90
dbw_mkz_twist_controller::TwistControllerNode * node
ros::Subscriber sub_joy_
Definition: JoystickDemo.h:73
ros::Publisher pub_steering_
Definition: JoystickDemo.h:76
void recvJoy(const sensor_msgs::Joy::ConstPtr &msg)
void cmdCallback(const ros::TimerEvent &event)
ros::Publisher pub_accelerator_pedal_
Definition: JoystickDemo.h:74
ros::Publisher pub_disable_
Definition: JoystickDemo.h:80


dbw_pacifica_joystick_speed_demo
Author(s): Jane Doe
autogenerated on Mon Apr 8 2019 02:29:49