osrf / rmf_core

Provides the centralized functions of RMF: scheduling, etc.
Apache License 2.0
102 stars 41 forks source link

rmf_fleet_adapter compilation issue - Waypoint set_charger #292

Closed alexchua0108 closed 3 years ago

alexchua0108 commented 3 years ago

Hi team,

Describe the bug When I trying to build the rmf_demo, it shows there is a compilation issue as below:

--- stderr: rmf_fleet_adapter
/home/rosi/rmf_demo_ws/src/rmf/rmf_core/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/parse_graph.cpp: In function ‘rmf_traffic::agv::Graph rmf_fleet_adapter::agv::parse_graph(const string&, const rmf_traffic::agv::VehicleTraits&)’: /home/rosi/rmf_demo_ws/src/rmf/rmf_core/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/parse_graph.cpp:119:14: error: ‘class rmf_traffic::agv::Graph::Waypoint’ has no member named ‘set_charger’ 119 | wp.set_charger(true); | ^~~ make[2]: *** [CMakeFiles/rmf_fleet_adapter.dir/build.make:219: CMakeFiles/rmf_fleet_adapter.dir/src/rmf_fleet_adapter/agv/parse_graph.cpp.o] Error 1

Workspace information:

Steps to Reproduce

  1. mkdir -p ~/rmf_demos_ws/src
  2. cd ~/rmf_demos_ws
  3. wget https://raw.githubusercontent.com/osrf/rmf_demos/master/rmf_demos.repos
  4. vcs import src < rmf_demos.repos
  5. source /opt/ros/foxy/setup.bash
  6. colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release

Temp Fixed I had commented out line114 to 120 from rmf_core/rmf_fleet_adapter/src/rmf_fleet_adapter/agv/parse_graph.cpp and it compiles

Yadunund commented 3 years ago

Hi Alex,

I am unable to reproduce the build error. Can you do a clean build of your workspace?

cd ~/rmf_demos_ws
rm -rf build/ install/ log/
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release

If you pulled the latest rmf_core in an existing workspace, you will have to rebuild the rmf_traffic package as the set_wapoint() and is_charger() methods were added to rmf_traffic::agv::Graph::Waypoint following this PR. Doing a clean build as suggested above should solve the problem.

mxgrey commented 3 years ago

@alexchua0108 Do you happen to have an old version of the ros-<distro>-rmf-traffic Debian package installed? We've seen cases where the distro-installed version of the package will be selected by cmake instead of the workspace version of the package, and that can cause this kind of build issue.

We haven't figured out the cause of this build system bug yet, but an easy way to circumvent it for now would be to uninstall the Debian packages for RMF.

alexchua0108 commented 3 years ago

Hi @Yadunund @mxgrey

Thanks for the help.

It is exactly like what @mxgrey had mentioned. I have an old version of the rmf-traffic Debian package that I install in November 2020.

After I do this:

sudo apt-get remove ros-foxy-rmf*

It successfully complies