Revision 0e77683c
ID | 0e77683c65f392af332f84aa9b31eb8614290a55 |
Added built-in scoutsim teleop!
scout/scoutsim/src/sim_frame.h | ||
---|---|---|
49 | 49 |
#include <wx/event.h> |
50 | 50 |
#include <wx/timer.h> |
51 | 51 |
#include <wx/string.h> |
52 |
#include <wx/utils.h> |
|
52 | 53 |
|
53 | 54 |
#include <ros/ros.h> |
54 | 55 |
|
55 | 56 |
#include <std_srvs/Empty.h> |
56 | 57 |
#include <scoutsim/Spawn.h> |
57 | 58 |
#include <scoutsim/Kill.h> |
59 |
#include <motors/set_motors.h> |
|
58 | 60 |
#include <map> |
59 | 61 |
|
60 | 62 |
#include "scout.h" |
... | ... | |
68 | 70 |
#define ID_MAP 4 |
69 | 71 |
#define ID_LINES 5 |
70 | 72 |
#define ID_WALLS 6 |
73 |
#define ID_TELEOP_NONE 7 |
|
74 |
#define ID_TELEOP_PRECISE 8 |
|
75 |
#define ID_TELEOP_FLUID 9 |
|
76 |
|
|
77 |
#define TELEOP_PRECISE_SPEED 30 |
|
78 |
#define TELEOP_FLUID_MAX_SPEED 80 |
|
79 |
|
|
80 |
// Teleop types |
|
81 |
#define TELEOP_OFF 0 |
|
82 |
#define TELEOP_PRECISE 1 |
|
83 |
#define TELEOP_FLUID 2 |
|
71 | 84 |
|
72 | 85 |
namespace scoutsim |
73 | 86 |
{ |
... | ... | |
86 | 99 |
void showMap(wxCommandEvent& event); |
87 | 100 |
void showLines(wxCommandEvent& event); |
88 | 101 |
void showWalls(wxCommandEvent& event); |
102 |
void stopTeleop(wxCommandEvent& event); |
|
103 |
void startTeleopPrecise(wxCommandEvent& event); |
|
104 |
void startTeleopFluid(wxCommandEvent& event); |
|
89 | 105 |
|
90 | 106 |
DECLARE_EVENT_TABLE() |
91 | 107 |
|
... | ... | |
93 | 109 |
void onUpdate(wxTimerEvent& evt); |
94 | 110 |
void onPaint(wxPaintEvent& evt); |
95 | 111 |
|
112 |
void teleop_move_precise(); |
|
113 |
void teleop_move_fluid(); |
|
114 |
void teleop(); |
|
115 |
|
|
96 | 116 |
void updateScouts(); |
97 | 117 |
void clear(); |
98 | 118 |
bool hasScout(const std::string& name); |
... | ... | |
107 | 127 |
ros::Subscriber wireless_send; |
108 | 128 |
ros::Publisher wireless_receive; |
109 | 129 |
|
130 |
// Teleop |
|
131 |
short teleop_l_speed; |
|
132 |
short teleop_r_speed; |
|
133 |
ros::Publisher teleop_pub; |
|
134 |
int teleop_type; |
|
135 |
|
|
136 |
short teleop_fluid_speed; |
|
137 |
short teleop_fluid_omega; |
|
138 |
|
|
110 | 139 |
ros::NodeHandle nh; |
111 | 140 |
wxTimer* update_timer; |
112 | 141 |
wxBitmap path_bitmap; |
... | ... | |
114 | 143 |
wxImage lines_image; |
115 | 144 |
wxImage walls_image; |
116 | 145 |
wxMemoryDC path_dc; |
117 |
wxMemoryDC sonar_dc;
|
|
146 |
wxMemoryDC sonar_dc;
|
|
118 | 147 |
|
119 | 148 |
uint64_t frame_count; |
120 | 149 |
|
Also available in: Unified diff