Project

General

Profile

Revision eb9cff77

IDeb9cff771c06a2ed3f37c591ed4c1ee0a20df76d
Parent b1fdaaf6
Child 96ec9388

Added by Hui Jun Tay over 11 years ago

Fixed sonar bug (corrected y direction)
Added sonar_toggle and set_scan command and callbacks
Cleaned up sonar_visual toggle code

View differences:

scout/scoutsim/src/scout.h
56 56
#include <encoders/query_encoders.h>
57 57
#include <linesensor/query_linesensor.h>
58 58
#include <sonar/sonar_distance.h>
59
#include <sonar/sonar_toggle.h>
60
#include <sonar/sonar_set_scan.h>
59 61

  
60 62
#include <scoutsim/Pose.h>
61 63
#include <scoutsim/SetPen.h>
......
114 116

  
115 117
            geometry_msgs::Pose2D update(double dt, wxMemoryDC& path_dc,
116 118
					 wxMemoryDC& sonar_dc,
117
					 bool sonar_on,
119
                     bool sonar_visual,
118 120
                                         const wxImage& path_image,
119 121
                                         const wxImage& lines_image,
120 122
                                         const wxImage& walls_image,
......
131 133
                                         encoders::query_encoders::Response&);
132 134
            bool query_linesensor_callback(linesensor::query_linesensor::Request&,
133 135
                                           linesensor::query_linesensor::Response&);
136
            bool handle_sonar_toggle(sonar::sonar_toggle::Request  &req,
137
                                     sonar::sonar_toggle::Response &res);
138
            bool handle_sonar_set_scan(sonar::sonar_set_scan::Request  &req,
139
                                       sonar::sonar_set_scan::Response &res);
134 140
            unsigned int rgb_to_grey(unsigned char r,
135 141
                                     unsigned char g,
136 142
                                     unsigned char b);
137 143
            unsigned int trace_sonar(const wxImage& walls_image, int x, int y,
138
                                     double robot_theta, int sonar_pos,wxMemoryDC& sonar_dc, bool sonar_on);
144
                                     double robot_theta, int sonar_pos,wxMemoryDC& sonar_dc);
139 145
            void update_sonar(const wxImage& walls_image, int x, int y,
140
                              double robot_theta, wxMemoryDC& sonar_dc,bool sonar_on);
146
                              double robot_theta, wxMemoryDC& sonar_dc);
141 147
            void update_linesensor(const wxImage& lines_image, int x, int y,
142 148
                                   double theta);
143 149
	    int old_front_dx;
......
147 153
	    bool isFront;
148 154

  
149 155
	    wxBitmap *path_bitmap;
150
	    bool sonar_on;
156
	    bool sonar_visual_on;
157
        bool sonar_on;
151 158

  
152 159
            ros::NodeHandle node;
153 160

  
......
195 202
            ros::ServiceServer set_pen_srv;
196 203
            ros::ServiceServer query_encoders_srv;
197 204
            ros::ServiceServer query_linesensor_srv;
205
            ros::ServiceServer toggle_sonar_srv;
206
            ros::ServiceServer set_sonar_srv;
198 207

  
199 208
            ros::WallTime last_command_time;
200 209

  

Also available in: Unified diff