Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maybe a problem existed in euroc_simulator/mav_gazebo_plugins/srcgazebo_octomap_plugin.cpp #123

Closed
HitszChen opened this issue Jan 5, 2015 · 5 comments

Comments

@HitszChen
Copy link
Contributor

Hi, guys,

   I found something that maybe incorrect, please check it. 

207 std::map<std::string, bool> objects_in_collision;
208
209 std::string entity_name, entity_name_backwards;
210 double dist, x;
211 math::Vector3 start, end, start_prev;
212
213 start.y = end.y = y;
214 start.z = end.z = z;
215
216 // Set the start point of the ray to the beginning of the bounding box
217 start.x = bounding_box_origin.x - bounding_box_lengths.x / 2 - leaf_size / 2;
218 x = start.x + leaf_size / 2;
219
220 // Set the end of the ray to some large value behind itself to check
221 // if there is a boundary of an object at the current y-z location in -x
222 end.x = -far_away;
223 ray->SetPoints(start, end);
224
225 // Check if there is an intersection in the back
226 ray->GetIntersection(dist, entity_name_backwards);
227
228 bool inside_object = CheckIfInsideObject(entity_name_backwards, start, ray);
229
230 // Set in_object to true, if currently in an object
231 if (!entity_name_backwards.empty() && inside_object) {
232 objects_in_collision.insert(std::pair<std::string, bool>(entity_name, true));

the variable "entity_name" in line 232 hasn't been valued or initialized, but inserted into the objects_in_collision. Should it be entity_name_backwards?

@markusachtelik
Copy link
Contributor

@burrimi can you have a look at this? @HitszChen this plugin created some problems with specific geometries, why we are currently using another method

@HitszChen
Copy link
Contributor Author

@markusachtelik I am trying to read through the code. Could you tell me what the another method is?

@ffurrer
Copy link
Contributor

ffurrer commented Jan 6, 2015

maybe we should also have a look at this:
https://bitbucket.org/osrf/gazebo/issue/858/rayshape-getintersection-behaves

to my understanding this would mean that we could set far_away = 999 or something around this value in https://github.com/ethz-asl/euroc_simulator/blob/master/mav_gazebo_plugins/src/gazebo_octomap_plugin.cpp#L77

@ffurrer
Copy link
Contributor

ffurrer commented Jan 6, 2015

@HitszChen I think you are right about the entity_name_backwards, I will look into it now.

@ffurrer
Copy link
Contributor

ffurrer commented Feb 19, 2015

At least the entity_name_backwards got fixed in dc90fec. Please make a new issue, if there are more problems with this.

@ffurrer ffurrer closed this as completed Feb 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants