Project

General

Profile

Revision 093a1aea

ID093a1aea09c86c812a439f1b4145c3e38123f651
Parent 43811241
Child 34a600c5

Added by Alex Zirbel about 4 years ago

"Fixed" the sonar bug.

Turns out the sonar just wasn't set to on by default, so nothing was being visualized.
Changed it so the sonar is on by default.
We should probably make it more clear when the sonar is off.

View differences:

scout/scoutsim/src/scout.cpp
64 64
                 float orient)
65 65
        : path_bitmap(path_bitmap)
66 66
          , sonar_visual_on(false)
67
          , sonar_on(true)
67 68
          , node (nh)
68 69
          , scout_image(scout_image)
69 70
          , pos(pos)
......
249 250
    unsigned int Scout::trace_sonar(const wxImage& walls_image, int x, int y,
250 251
                                    double robot_theta, int sonar_pos, 
251 252
                                    wxMemoryDC& sonar_dc)
252

  
253 253
    {
254 254
        double angle = robot_theta + (PI * ((float) sonar_pos) / 24.0) - PI / 2;
255 255
        unsigned int d = 0;
......
521 521

  
522 522
    void Scout::set_sonar_visual(bool on)
523 523
    {
524
        /// @todo Remove
525
        ROS_INFO("Sonar visual on set.");
526 524
        sonar_visual_on = on;
527 525
    }
528 526
}
scout/scoutsim/src/scout.h
139 139
                                     unsigned char g,
140 140
                                     unsigned char b);
141 141
            unsigned int trace_sonar(const wxImage& walls_image, int x, int y,
142
                                   double robot_theta, int sonar_pos,
143
                                    wxMemoryDC& sonar_dc);
142
                                     double robot_theta, int sonar_pos,
143
                                     wxMemoryDC& sonar_dc);
144 144

  
145 145
            void update_sonar(const wxImage& walls_image, int x, int y,
146 146
                              double robot_theta, wxMemoryDC& sonar_dc);

Also available in: Unified diff