Project

General

Profile

Revision 6639ce9c

ID6639ce9c5b5ca4644e9f66e71b7d79bc24cf4fb0

Added by viki over 11 years ago

Edited Sonar to display points on simulator.

Changed rate of sonar scan to 0.5s
Made a new wxDC graphics object for sonar

View differences:

scout/scoutsim/src/sim_frame.cpp
217 217

  
218 218
        ScoutPtr t(new Scout(ros::NodeHandle(real_name),
219 219
                   scout_images[rand() % SCOUTSIM_NUM_SCOUTS],
220
                   Vector2(x, y), angle));
220
                   Vector2(x, y), &path_bitmap,angle));
221 221
        scouts[real_name] = t;
222 222

  
223 223
        ROS_INFO("Spawning scout [%s] at x=[%f], y=[%f], theta=[%f]",
......
269 269
        path_dc.SetBackground(wxBrush(wxColour(100, 100, 100)));
270 270
        path_dc.Clear();
271 271

  
272
        sonar_dc.SetBackground(wxBrush(wxColour(255, 0, 0)));
273
        sonar_dc.Clear();
274

  
275
        sonar_dc.SelectObject(path_bitmap);
276

  
272 277
        path_bitmap.LoadFile(wxString::FromAscii(display_map_name.c_str()));
273 278
        path_dc.SelectObject(path_bitmap);
274 279
        SetSize(wxSize(path_bitmap.GetWidth(), path_bitmap.GetHeight()));
......
323 328

  
324 329
        for (; it != end; ++it)
325 330
        {
326
            it->second->update(0.016, path_dc,
331
            it->second->update(0.016, path_dc,sonar_dc,
327 332
                               path_image, lines_image, walls_image,
328 333
                               path_dc.GetBackground().GetColour(),
334
			       sonar_dc.GetBackground().GetColour(),
329 335
                               state);
330 336
        }
331 337

  

Also available in: Unified diff