leggedrobotics / ocs2

Optimal Control for Switched Systems
https://leggedrobotics.github.io/ocs2
BSD 3-Clause "New" or "Revised" License
836 stars 221 forks source link

It seems that a cpp file to "SegmentedPlanesSignedDistanceField.h" is missing in ocs2_robotic_examples/ocs2_perceptive_anymal/segmented_planes_terrain_model/src #90

Open Mayflyday opened 9 months ago

Mayflyday commented 9 months ago

In OCS2 V12.0 Errors
/home/user/ocsws/src/ocs2/ocs2_robotic_examples/ocs2_perceptive_anymal/segmented_planes_terrain_model/include/segmented_planes_terrain_model/SegmentedPlanesSignedDistanceField.h: In constructor ‘switched_model::SegmentedPlanesSignedDistanceField::SegmentedPlanesSignedDistanceField(const grid_map::GridMap&, const string&, double, double)’: /home/user/ocsws/src/ocs2/ocs2_robotic_examples/ocs2_perceptive_anymal/segmented_planes_terrain_model/include/segmented_planes_terrain_model/SegmentedPlanesSignedDistanceField.h:23:59: error: no matching function for call to ‘grid_map::SignedDistanceField::SignedDistanceField(const gridmap::GridMap&, const string&, double&, double&)’ 23 | : sdf(gridMap, elevationLayer, minHeight, maxHeight) {}

NmBoyd commented 7 months ago

Looks like this is a dependency from elveation_mapping_cupy. Which makes some sense since grid map is very closely related to elevation_mapping. Also seems to be an issue with packages missing grid_map_filters_rsl Try adding this package and rebuilding: https://github.com/leggedrobotics/elevation_mapping_cupy/tree/main/plane_segmentation

JunJieChenpete commented 6 months ago

The Errors shows that the class grid_map::SignedDistanceField corresponding to sdf_ does not have the grid_map::SignedDistanceField::SignedDistanceField(const grid_map::GridMap&, const string&, double&, double&) method. I guess that the grid_map library you are using comes from the command like sudo apt install ros-noetic-grid-map*, the libraries inside have not been updated. I specifically went to the source file to view it, and you can see that there is indeed no construction method mentioned above. image however, when you go to github to find the source code, you will find that this piece of code has been updated. image So, you should remove the grid_map library with the command sudo apt remove ros-noetic-grid-map* , then clone source code from github directly with command git clone git@github.com:ANYbotics/grid_map.git into your src folder, and re catkin build.

Dicer-J commented 5 months ago

The Errors shows that the class grid_map::SignedDistanceField corresponding to sdf_ does not have the grid_map::SignedDistanceField::SignedDistanceField(const grid_map::GridMap&, const string&, double&, double&) method. I guess that the grid_map library you are using comes from the command like sudo apt install ros-noetic-grid-map*, the libraries inside have not been updated. I specifically went to the source file to view it, and you can see that there is indeed no construction method mentioned above. image however, when you go to github to find the source code, you will find that this piece of code has been updated. image So, you should remove the grid_map library with the command sudo apt remove ros-noetic-grid-map* , then clone source code from github directly with command git clone git@github.com:ANYbotics/grid_map.git into your src folder, and re catkin build.

Very helpful!