globals.h
Go to the documentation of this file.
1 /*
2 * Unpublished Copyright (c) 2009-2018 AutonomouStuff, LLC, All Rights Reserved.
3 *
4 * This file is part of the PACMod ROS 1.0 driver which is released under the MIT license.
5 * See file LICENSE included with this software or go to https://opensource.org/licenses/MIT for full license details.
6 */
7 
8 #ifndef GLOBALS_H
9 #define GLOBALS_H
10 
11 #include <cstdio>
12 #include <mutex>
13 #include <unordered_map>
14 
15 #include <ros/ros.h>
16 #include <sensor_msgs/Joy.h>
17 #include <std_msgs/Bool.h>
18 #include <pacmod_msgs/VehicleSpeedRpt.h>
19 
20 namespace AS
21 {
22 namespace Joystick
23 {
24 
25 // Enums
27 {
31  SHIFT_LOW = 3,
33 };
34 
36 {
41 };
42 
44 {
50 };
51 
53 {
61 };
62 
63 enum JoyAxis
64 {
71  LEFT_TRIGGER_AXIS, // Sometimes button, sometimes axis
72  RIGHT_TRIGGER_AXIS // Sometimes button, sometimes axis
73 };
74 
76 {
85  LEFT_TRIGGER_BTN, // Sometimes button, sometimes axis
86  RIGHT_TRIGGER_BTN, // Sometimes button, sometimes axis
89 };
90 
91 struct EnumHash
92 {
93  template <typename T>
94  std::size_t operator()(T t) const
95  {
96  return static_cast<std::size_t>(t);
97  }
98 };
99 
100 // static constants
101 static const float ROT_RANGE_SCALER_LB = 0.05;
102 static const float ACCEL_SCALE_FACTOR = 0.6;
103 static const float ACCEL_OFFSET = 0.21;
104 static const float STEER_SCALE_FACTOR = 1.5;
105 static const float STEER_OFFSET = 1.0;
106 static const float MAX_ROT_RAD_VEHICLE2 = 6.5;
107 static const float MAX_ROT_RAD_VEHICLE4 = 8.5;
108 static const float MAX_ROT_RAD_VEHICLE5 = 8.1;
109 static const float MAX_ROT_RAD_VEHICLE6 = 8.5;
110 static const float MAX_ROT_RAD_DEFAULT = 10.9956;
111 static const float AXES_MIN = -1.0;
112 static const float AXES_MAX = 1.0;
113 static const uint16_t NUM_WIPER_STATES = 8;
114 static const uint16_t WIPER_STATE_START_VALUE = 0;
115 static const uint16_t NUM_HEADLIGHT_STATES = 3;
116 static const uint16_t HEADLIGHT_STATE_START_VALUE = 0;
117 static const uint16_t INVALID = -1;
118 static const uint16_t BUTTON_DOWN = 1;
119 
120 // mutex
121 static std::mutex enable_mutex;
122 static std::mutex speed_mutex;
123 static std::mutex state_change_mutex;
124 static std::mutex shift_mutex;
125 static std::mutex turn_mutex;
126 
127 }
128 }
129 
130 #endif
static const float ROT_RANGE_SCALER_LB
Definition: globals.h:101
static std::mutex state_change_mutex
Definition: globals.h:123
static const float MAX_ROT_RAD_VEHICLE4
Definition: globals.h:107
static const float AXES_MIN
Definition: globals.h:111
static const float AXES_MAX
Definition: globals.h:112
static std::mutex speed_mutex
Definition: globals.h:122
static const float MAX_ROT_RAD_VEHICLE6
Definition: globals.h:109
Definition: globals.h:20
static const float ACCEL_OFFSET
Definition: globals.h:103
static const uint16_t BUTTON_DOWN
Definition: globals.h:118
static const float STEER_OFFSET
Definition: globals.h:105
static std::mutex turn_mutex
Definition: globals.h:125
static const float ACCEL_SCALE_FACTOR
Definition: globals.h:102
static const float MAX_ROT_RAD_VEHICLE2
Definition: globals.h:106
static const uint16_t INVALID
Definition: globals.h:117
static const uint16_t WIPER_STATE_START_VALUE
Definition: globals.h:114
static std::mutex enable_mutex
Definition: globals.h:121
static std::mutex shift_mutex
Definition: globals.h:124
std::size_t operator()(T t) const
Definition: globals.h:94
static const float MAX_ROT_RAD_DEFAULT
Definition: globals.h:110
static const uint16_t HEADLIGHT_STATE_START_VALUE
Definition: globals.h:116
static const uint16_t NUM_HEADLIGHT_STATES
Definition: globals.h:115
static const float MAX_ROT_RAD_VEHICLE5
Definition: globals.h:108
static const float STEER_SCALE_FACTOR
Definition: globals.h:104
static const uint16_t NUM_WIPER_STATES
Definition: globals.h:113


pacmod_game_control
Author(s): Joe Driscoll
autogenerated on Thu Jun 6 2019 19:19:40