Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef UOS_DIFFDRIVE_TELEOP_PS3JOY_H
00026 #define UOS_DIFFDRIVE_TELEOP_PS3JOY_H
00027
00028 #include <ros/ros.h>
00029 #include <uos_diffdrive_teleop.h>
00030 #include <sensor_msgs/Joy.h>
00031
00032 #define PS3_BUTTON_SELECT 0
00033 #define PS3_BUTTON_STICK_LEFT 1
00034 #define PS3_BUTTON_STICK_RIGHT 2
00035 #define PS3_BUTTON_START 3
00036 #define PS3_BUTTON_CROSS_UP 4
00037 #define PS3_BUTTON_CROSS_RIGHT 5
00038 #define PS3_BUTTON_CROSS_DOWN 6
00039 #define PS3_BUTTON_CROSS_LEFT 7
00040 #define PS3_BUTTON_REAR_LEFT_2 8
00041 #define PS3_BUTTON_REAR_RIGHT_2 9
00042 #define PS3_BUTTON_REAR_LEFT_1 10
00043 #define PS3_BUTTON_REAR_RIGHT_1 11
00044 #define PS3_BUTTON_ACTION_TRIANGLE 12
00045 #define PS3_BUTTON_ACTION_CIRCLE 13
00046 #define PS3_BUTTON_ACTION_CROSS 14
00047 #define PS3_BUTTON_ACTION_SQUARE 15
00048 #define PS3_BUTTON_PAIRING 16
00049
00050 #define PS3_AXIS_STICK_LEFT_LEFTWARDS 0
00051 #define PS3_AXIS_STICK_LEFT_UPWARDS 1
00052 #define PS3_AXIS_STICK_RIGHT_LEFTWARDS 2
00053 #define PS3_AXIS_STICK_RIGHT_UPWARDS 3
00054 #define PS3_AXIS_BUTTON_CROSS_UP 4
00055 #define PS3_AXIS_BUTTON_CROSS_RIGHT 5
00056 #define PS3_AXIS_BUTTON_CROSS_DOWN 6
00057 #define PS3_AXIS_BUTTON_CROSS_LEFT 7
00058 #define PS3_AXIS_BUTTON_REAR_LEFT_2 8
00059 #define PS3_AXIS_BUTTON_REAR_RIGHT_2 9
00060 #define PS3_AXIS_BUTTON_REAR_LEFT_1 10
00061 #define PS3_AXIS_BUTTON_REAR_RIGHT_1 11
00062 #define PS3_AXIS_BUTTON_ACTION_TRIANGLE 12
00063 #define PS3_AXIS_BUTTON_ACTION_CIRCLE 13
00064 #define PS3_AXIS_BUTTON_ACTION_CROSS 14
00065 #define PS3_AXIS_BUTTON_ACTION_SQUARE 15
00066 #define PS3_AXIS_ACCELEROMETER_LEFT 16
00067 #define PS3_AXIS_ACCELEROMETER_FORWARD 17
00068 #define PS3_AXIS_ACCELEROMETER_UP 18
00069 #define PS3_AXIS_GYRO_YAW 19
00070
00071 class TeleopPS3 : public Teleop
00072 {
00073 public:
00074 TeleopPS3();
00075
00076 private:
00077 ros::Subscriber joy_sub;
00078 bool use_button_pressure;
00079 void PS3Callback(const sensor_msgs::Joy::ConstPtr& joy);
00080 };
00081
00082 #endif
00083