Skip to content

CMake fix and cleanup abstract class#6

Merged
AndyZe merged 4 commits intoAndyZe:feature/hybrid_planningfrom
sjahr:pr-hybrid_planning_cmake_fix
Dec 6, 2021
Merged

CMake fix and cleanup abstract class#6
AndyZe merged 4 commits intoAndyZe:feature/hybrid_planningfrom
sjahr:pr-hybrid_planning_cmake_fix

Conversation

@sjahr
Copy link
Copy Markdown

@sjahr sjahr commented Dec 3, 2021

Description

When I tried to add hybrid planning as a dependency in a different package I got several CMake errors/warnings like this:

CMake Warning at /home/sebi/ws_thesis/install/moveit_hybrid_planning/share/moveit_hybrid_planning/cmake/ament_cmake_export_include_directories-extras.cmake:11 (message):
  Package 'moveit_hybrid_planning' exports the include directory
  '/home/sebi/ws_thesis/install/moveit_hybrid_planning/share/moveit_hybrid_planning/cmake/../../../global_planner/global_planner_component/include/'
  which doesn't exist
Call Stack (most recent call first):
  /home/sebi/ws_thesis/install/moveit_hybrid_planning/share/moveit_hybrid_planning/cmake/moveit_hybrid_planningConfig.cmake:41 (include)
  CMakeLists.txt:5 (find_package)
CMake Error at CMakeLists.txt:17 (add_library):
  Target "mpi_solver" links to target
  "moveit_hybrid_planning::hybrid_planning_demo_node" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?

I fixed them by installing the hybrid_planning_demo_node separately and thus prevented it from being exported as part of the hybrid planning dependency and by updating the exported include directory.

Furthermore, I removed the getTargetWayPointIndex function from the abstract class because I think it is not essential and can be added to the child class if required. I became aware that we only define it in the SimpleSampler class but never use it anywhere (except I've overlooked it somewhere). @AndyZe maybe it can be removed completely what do you think?

Checklist

  • Required by CI: Code is auto formatted using clang-format
  • Extend the tutorials / documentation reference
  • Document API changes relevant to the user in the MIGRATION.md notes
  • Create tests, which fail without this PR reference
  • Include a screenshot if changing a GUI
  • While waiting for someone to review your request, please help review another open pull request to support the maintainers

@sjahr sjahr changed the title Pr hybrid planning cmake fix CMake fix and cleanup abstract class Dec 3, 2021
@sjahr
Copy link
Copy Markdown
Author

sjahr commented Dec 3, 2021

@henningkayser

@AndyZe
Copy link
Copy Markdown
Owner

AndyZe commented Dec 3, 2021

Yes, let's remove getTargetWayPointIndex() since it isn't used. 👍 Will push a commit for that

@AndyZe
Copy link
Copy Markdown
Owner

AndyZe commented Dec 3, 2021

Running the demo today, I get an error about the OMPL planning pipeline not loading. Sigh. I wonder if it's something to do with my workspace. (It's not just your branch, my branch has the same error.)

I'm on the latest commit of moveit_resources, ros2 branch.

@AndyZe AndyZe force-pushed the feature/hybrid_planning branch from a154265 to e8c5d1b Compare December 3, 2021 15:30
@henningkayser
Copy link
Copy Markdown

henningkayser commented Dec 3, 2021

Yes, let's remove getTargetWayPointIndex() since it isn't used. +1 Will push a commit for that

How are you supposed to get the target waypoint from the local solver if the TrajectoryOperator doesn't have a function to provide it? I thought the whole idea about this class is that it defines the logic what the next waypoint is based on the current state. But maybe there is another way to do the same thing.

@sjahr
Copy link
Copy Markdown
Author

sjahr commented Dec 3, 2021

Yes, let's remove getTargetWayPointIndex() since it isn't used. +1 Will push a commit for that

How are you supposed to get the target waypoint from the local solver if the TrajectoryOperator doesn't have a function to provide it? I thought the whole idea about this class is that it defines the logic what the next waypoint is based on the current state. But maybe there is another way to do the same thing.

Yes, it is done within the operator and the local solver receives a local trajectory through a call of

getLocalTrajectory(const moveit::core::RobotState& current_state, robot_trajectory::RobotTrajectory& local_trajectory)

The local trajectory for the solver could contain more than a single waypoint. This is why I think this function is only useful in local sampler which only forwards a single waypoint of the global trajectory. getTargetWaypointIndex() is implemented in the simple_sampler to disclose the internal member variable.:

size_t SimpleSampler::getTargetWayPointIndex()
{
  return next_waypoint_index_;
}

But it was not used.

@AndyZe
Copy link
Copy Markdown
Owner

AndyZe commented Dec 3, 2021

getTargetWayPointIndex() is something I added just recently for detecting if the local planner was stuck for X iterations. But, I think I implemented it in the wrong place.

@AndyZe AndyZe force-pushed the feature/hybrid_planning branch 2 times, most recently from 6411258 to ca2867c Compare December 6, 2021 16:28
@AndyZe AndyZe force-pushed the pr-hybrid_planning_cmake_fix branch from 25a56ec to 8af33eb Compare December 6, 2021 16:59
@AndyZe AndyZe merged commit d35e41d into AndyZe:feature/hybrid_planning Dec 6, 2021
AndyZe pushed a commit that referenced this pull request Dec 7, 2021
* Install hybrid_planning_demo_node separately to avoid exporting it

* Fix exported include directory

* Remove getTargetWayPointIndex() from abstract trajectory operator class

* Delete unused getTargetWayPointIndex()

Co-authored-by: AndyZe <zelenak@picknik.ai>
AndyZe pushed a commit that referenced this pull request Dec 7, 2021
* Install hybrid_planning_demo_node separately to avoid exporting it

* Fix exported include directory

* Remove getTargetWayPointIndex() from abstract trajectory operator class

* Delete unused getTargetWayPointIndex()

Co-authored-by: AndyZe <zelenak@picknik.ai>
AndyZe pushed a commit that referenced this pull request Dec 7, 2021
* Install hybrid_planning_demo_node separately to avoid exporting it

* Fix exported include directory

* Remove getTargetWayPointIndex() from abstract trajectory operator class

* Delete unused getTargetWayPointIndex()
AndyZe pushed a commit that referenced this pull request Dec 7, 2021
* Install hybrid_planning_demo_node separately to avoid exporting it

* Fix exported include directory

* Remove getTargetWayPointIndex() from abstract trajectory operator class

* Delete unused getTargetWayPointIndex()
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

Successfully merging this pull request may close these issues.

3 participants