Project

General

Profile

Revision c63c9752

IDc63c97520e4ba4810364a2b18151db6f250300b8
Parent 0076084e
Child e2751853

Added by Alex Zirbel over 11 years ago

Scoutsim now has consistent units of m and m/s.

This will cause some problems.

  • Behaviors which relied on the old units will have to change. We need to change the Control classes to scale things right.
  • Encoder ticks are almost fixed, but not quite right (I think because of a rounding problem).
  • Speeds are now all in m/s, which is much different than before - we'll have to change the Control class somehow.

I'm afraid I'm out of time to make the rest of these changes now, but I'll do them ASAP.

View differences:

scout/scoutsim/src/scout.h
70 70

  
71 71
#define PI 3.14159265
72 72

  
73
/// The scale factor so the speed of scout robots is reasonable for the sim
74
#define SPEED_SCALE_FACTOR 0.05
75

  
76 73
#define NUM_LINESENSORS 8
77 74

  
78 75
// Distance, pixels, from center of robot to the linesensors.
......
135 132
                                     unsigned char g,
136 133
                                     unsigned char b);
137 134
            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);
135
                                     double robot_theta, int sonar_pos,
136
                                     wxMemoryDC& sonar_dc, bool sonar_on);
139 137
            void update_sonar(const wxImage& walls_image, int x, int y,
140 138
                              double robot_theta, wxMemoryDC& sonar_dc,bool sonar_on);
141 139
            void update_linesensor(const wxImage& lines_image, int x, int y,
142 140
                                   double theta);
143
	    int old_front_dx;
144
	    int old_front_dy;
145
	    int old_back_dx;
146
	    int old_back_dy;
147
	    bool isFront;
141
            int old_front_dx;
142
            int old_front_dy;
143
            int old_back_dx;
144
            int old_back_dy;
145
            bool isFront;
148 146

  
149
	    wxBitmap *path_bitmap;
150
	    bool sonar_on;
147
            wxBitmap *path_bitmap;
148
            bool sonar_on;
151 149

  
152 150
            ros::NodeHandle node;
153 151

  
......
175 173
            int sonar_stop_l;
176 174
            int sonar_stop_r;
177 175
            int sonar_direction;
176

  
178 177
            // The last time the sonar changed its position.
179 178
            ros::Time last_sonar_time;
180 179
            ros::Duration sonar_tick_time;
......
197 196
            ros::ServiceServer query_linesensor_srv;
198 197

  
199 198
            ros::WallTime last_command_time;
200

  
201
            float meter;
202

  
203 199
    };
204 200
    typedef boost::shared_ptr<Scout> ScoutPtr;
205

  
206 201
}
207 202

  
208 203
#endif

Also available in: Unified diff