RobustFieldAutonomyLab / turtlebot_exploration_3d

Autonomous Exploration package for a Turtulebot equiped with RGBD Sensor(Kinect, Xtion)
Other
152 stars 39 forks source link

about the code #15

Open pineappleKID opened 3 years ago

pineappleKID commented 3 years ago

line 293 - line 306 of the file turtlebot_exploration_3d.cpp is

        Candidates_pub.publish(CandidatesMarker_array);
        CandidatesMarker_array.markers.clear();
        candidates.clear();

        // loop in the idx_MI, if the candidate with max MI cannot be achieved, 
        // switch to a sub-optimal MI.
        arrived = false;
        int idx_ptr = 0;

        while (!arrived) {
            // Setup the Goal
            next_vp = point3d(candidates[idx_MI[idx_ptr]].first.x(),candidates[idx_MI[idx_ptr]].first.y(),candidates[idx_MI[idx_ptr]].first.z());
            Goal_heading.setRPY(0.0, 0.0, candidates[idx_MI[idx_ptr]].second.yaw());
            Goal_heading.normalize();

I also show the code block as an image

image

Since candidates is used in line 304, we should not clear candidates in line 295