Skip to content
This repository has been archived by the owner on Mar 10, 2023. It is now read-only.

bug fix about issue #5 #6

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Tasaki-Lab
Copy link

Bug fix

Fixed bug

I fix the bug about issue 5.
#5

Fix applied

Grids of the cost map generated by costmap_generator are not placed correctlly.
For example, maybe, we want the point's position (0.3, 0.5) in the costmap coordinate to be placed cost map index (0, 0).

In the case of previous code:
the position (0.3, 0.5) -> cost map index (1, 1)

New feature implementation

the position (0.3, 0.5) -> cost map index (0, 0)

Implemented feature

int mapped_x_ind = std::ceil(mapped_x);
-->
int mapped_x_ind = (int)mapped_x;

@Tasaki-Lab Tasaki-Lab force-pushed the core_planning_Tasaki-Lab_branch branch from 2269488 to 347a746 Compare June 25, 2020 02:01
@Tasaki-Lab Tasaki-Lab force-pushed the core_planning_Tasaki-Lab_branch branch from 2ee7882 to e3aebd1 Compare June 25, 2020 04:31
Signed-off-by: Tasaki-Lab <[email protected]>
@Tasaki-Lab Tasaki-Lab force-pushed the core_planning_Tasaki-Lab_branch branch from 67431ad to 2dc4143 Compare June 25, 2020 04:39
@JWhitleyWork
Copy link

@Tasaki-Lab It appears that this change intermittently causes a segmentation fault. Can you please try keeping the std::ceil call and wrapping it in static_cast<int>?

@Tasaki-Lab
Copy link
Author

Tasaki-Lab commented Jun 27, 2020

I think isValidInd has a bug.

In GridMap::setGeometry, the size of cost map is defined as:
00059 size(0) = static_cast(round(length(0) / resolution)); // There is no round() function in Eigen.
00060 size(1) = static_cast(round(length(1) / resolution));

So, I modify the code. (Tested by Moriyama data)

Signed-off-by: Tasaki-Lab <[email protected]>
@Tasaki-Lab Tasaki-Lab force-pushed the core_planning_Tasaki-Lab_branch branch from f8625d0 to a7cfc17 Compare June 27, 2020 04:43
@JWhitleyWork
Copy link

@Tasaki-Lab Where are you seeing the code that you're talking about? Can you provide a link? I don't see any round function used in costmap_generator at all.

@Tasaki-Lab
Copy link
Author

@Tasaki-Lab Where are you seeing the code that you're talking about? Can you provide a link? I don't see any round function used in costmap_generator at all.

Autoware uses grid_map_ros provided by ROS package, right?

costmap_generator.cpp (line 124) uses setGeometry provided by the ROS package.
In the ROS package code (line 00059-00060), GridMap::setGeometry uses the round function.
http://docs.ros.org/jade/api/grid_map_core/html/GridMap_8cpp_source.html#l00051

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants