open-rmf / fleet_adapter_tb4

Open-RMF full control fleet adapter for the Turtlebot 4 and other robots running Navigation2
Apache License 2.0
6 stars 1 forks source link

EasyFullControl.hpp not found in humble #3

Open TheConstructAi opened 1 year ago

TheConstructAi commented 1 year ago

Bug report

/home/user/ros2_ws/src/fleet_adapter_tb4/fleet_adapter_tb/src/FleetAdapter.hpp:24:10: fatal error: rmf_fleet_adapter/agv/EasyFullControl.hpp: No suchfile or directory 24 | #include <rmf_fleet_adapter/agv/EasyFullControl.hpp> | ^~~~~~~~~~~

Required information:

Description of the bug

When compiling, it doesn't find this rmf_fleet_adapter/agv/EasyFullControl.hpp. After close inspection, this is not present in the source installation of RMF for humble. Any idea why? I this EasyFullControl not supported anymore?

Screenshot from 2023-01-02 19-36-15

Steps to reproduce the bug

Install rmf by source for humble download the latest version of this git for tb4 adapter an compile.

Expected behavior

I would expect that works with the latest version iunles there is something I'm missing or this adapter has no support anymore

Extra

I imagine that the preferred way to create adapters is now using the templates and the examples of the awesome_adapters.

Thanks in advance

Yadunund commented 1 year ago

Thanks for raising the issue.

The EasyFullControl API is a work in progress in this PR https://github.com/open-rmf/rmf_ros2/pull/235

The API is still being refined before it can be merged into main. The goal is to make the experience of using this API as easy as possible for users. This fleet adapter is written using this beta API. If you would like to build this adapter, kindly switch to the feature/easy_full_control branch in rmf_ros2.

I'll leave this ticket open until we merge that branch into main.

TheConstructAi commented 1 year ago

After changing and recompiling the _rmfros2 in branch feature/easy_full_control Having now this error when compiling:

--- stderr: fleet_adapter_tb
/home/user/ros2_ws/src/fleet_adapter_tb4/fleet_adapter_tb/src/FleetAdapter.cpp:239:16: error: no matching constructor for initialization of 'FleetAdapter::RobotState' (aka 'rmf_fleet_adapter::agv::EasyFullControl::RobotState')
  auto state = RobotState(
...

/home/user/ros2_ws/src/fleet_adapter_tb4/fleet_adapter_tb/src/FleetAdapter.cpp:362:10: error: no viable conversion from returned value of type '(lambda at /home/user/ros2_ws/src/fleet_adapter_tb4/fleet_adapter_tb/src/FleetAdapter.cpp:355:5)' to function return type 'FleetAdapter::GoalCompletedCallback' (aka 'function<rmf_fleet_adapter::agv::EasyFullControl::GoalStatus ()>')
  return cb;

Any ideas of what could it be?

I changed to the branch yadu/easy_full_control and now it compiles at least. I'll see if it works now

TheConstructAi commented 1 year ago

[fleet_adapter-1] [INFO] [1672747561.320252385] [fleet_adapter_tb]: Failed to create EasyFullControl adapter instance.

[ERROR] [fleet_adapter-1]: process has died [pid 30511, exit code -11, cmd '/home/user/ros2_ws/install/fleet_adapter_tb/lib/fleet_adapter_tb/fleet_adapter --ros-args -r node:=fleet_adapter_tb -r ns:=/ --params-file /tmp/launch_params_bbhpc0_u --params-file /tmp/launch_params_20y5w80w --params-file /tmp/launch_params_6twc1025'].

When launched it states this, no mor info, so I don't know exactly where is failing. Is there any way to get more verbose to know where exactly is failing?

Yadunund commented 1 year ago

Switching to yadu/easy_full_control is not a good long term solution. It would be great if you could open a PR here to get it to compile with feature/easy_full_control. Unfortunately, I don't have the bandwidth at the moment to fix this issue.

Regarding the runtime issue, are you able to share the entire terminal log from launch till crash?

TheConstructAi commented 1 year ago

Sure ;):

This is all the output

ros2 launch fleet_adapter_tb fleet_adapter_turtleenv.launch.py
[INFO] [launch]: All log files can be found below /home/user/.ros/log/2023-01-03-14-26-02-088405-1_xterm-56990
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [fleet_adapter-1]: process started with pid [56991]
[fleet_adapter-1] [INFO] [1672755962.282235652] [fleet_adapter_tb]: Starting fleet_adapter_tb
[fleet_adapter-1] [INFO] [1672755962.282372309] [fleet_adapter_tb]: Configuring fleet [barista].
[fleet_adapter-1] [WARN] [1672755962.286694179] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodeswith the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic.
[fleet_adapter-1] [INFO] [1672755962.296888904] [fleet_adapter_tb]: Parameter [discovery_timeout] set to: 60.000000

[fleet_adapter-1] [INFO] [1672756022.355973455] [fleet_adapter_tb]: Failed to create EasyFullControl adapter instance.
[ERROR] [fleet_adapter-1]: process has died [pid 56991, exit code -11, cmd '/home/user/ros2_ws/install/fleet_adapter_tb/lib/fleet_adapter_tb/fleet_adapter --ros-args -r __node:=fleet_adapter_tb -r __ns:=/ --params-file /tmp/launch_params_zh2z8yr5 --params-file /tmp/launch_params_vd5ruhq5 --params-file /tmp/launch_params_dcmoe9ae'].

Directly the command:

/home/user/ros2_ws/install/fleet_adapter_tb/lib/fleet_adapter_tb/fleet_adapter --ros-args -r __node:=fleet_adapter_tb -r __ns:=/ --params-file /tmp/launch_params_g11c2upn --params-file /tmp/launch_params_qy09z6qt --params-file /tmp/launch_params_zktrnycz
[INFO] [1672756944.421795403] [fleet_adapter_tb]: MOD Starting fleet_adapter_tb
[INFO] [1672756944.421955736] [fleet_adapter_tb]: Configuring fleet [barista].
[WARN] [1672756944.425898625] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic.
[INFO] [1672756944.436313335] [fleet_adapter_tb]: Parameter [discovery_timeout] set to: 60.000000
[INFO] [1672757004.486374806] [fleet_adapter_tb]: Finished EasyFullControl make...
[INFO] [1672757004.486436087] [fleet_adapter_tb]: Failed to create EasyFullControl adapter instance.
Segmentation fault (core dumped)

I'm looking into the code to see whats going on there in case its not finding the navigate_to_pose action server or something similar related to the parameters.

As for opening a PR, no problem, just want to at least have this working an then we can backtrack to feture/easy_full_control branch and see why its not compiling

TheConstructAi commented 1 year ago

I've posted a pull request to "fix" one of the errors of compilation using the feature/easy_full_control branch f the rmf_ros2 repo: Pull REquest

I just placed a false in the action input of theRobotState` initialization ( although I don't really understand what's the use of that variable) but its compulsory for the init of that RobotState.

As for the other error related to the callback, no idea for the moment why this is happening:

/home/user/ros2_ws/src/fleet_adapter_tb4/fleet_adapter_tb/src/FleetAdapter.cpp: In member function 'FleetAdapter::GoalCompletedCallback FleetAdapter::Robot::navigate(const string&, Eigen::Vector3d, FleetAdapter::RobotUpdateHandlePtr)':
/home/user/ros2_ws/src/fleet_adapter_tb4/fleet_adapter_tb/src/FleetAdapter.cpp:260:10: error: could not convert 'cb' from 'FleetAdapter::Robot::navigate(const string&, Eigen::Vector3d, FleetAdapter::RobotUpdateHandlePtr)::<lambda(rmf_traffic::Duration&, bool&)>' to 'FleetAdapter::GoalCompletedCallback' {aka 'std::function<rmf_fleet_adapter::agv::EasyFullControl::GoalStatus()>'}
  260 |   return cb;
      |          ^~
      |          |
      |          FleetAdapter::Robot::navigate(const string&, Eigen::Vector3d, FleetAdapter::RobotUpdateHandlePtr)::<lambda(rmf_traffic::Duration&, bool&)>

/home/user/ros2_ws/src/fleet_adapter_tb4/fleet_adapter_tb/src/FleetAdapter.cpp: In member function 'FleetAdapter::GoalCompletedCallback FleetAdapter::Robot::dock(const string&, FleetAdapter::RobotUpdateHandlePtr)':
/home/user/ros2_ws/src/fleet_adapter_tb4/fleet_adapter_tb/src/FleetAdapter.cpp:278:10: error: could not convert 'cb' from 'FleetAdapter::Robot::dock(const string&, FleetAdapter::RobotUpdateHandlePtr)::<lambda(rmf_traffic::Duration&, bool&)>' to 'FleetAdapter::GoalCompletedCallback' {aka 'std::function<rmf_fleet_adapter::agv::EasyFullControl::GoalStatus()>'}
  278 |   return cb;
      |          ^~
      |          |
      |          FleetAdapter::Robot::dock(const string&, FleetAdapter::RobotUpdateHandlePtr)::<lambda(rmf_traffic::Duration&, bool&)>
TheLastImperial commented 1 year ago

I have the same error. To fix it I compile the original version of fleet_adapter_tb4 but with rmf_ros2 using rmf_fleet_adapter and rmf_fleet_adapter_tb4 from the branch feature/easy_full_control and the another packages from humble branch (this fork).

Now I have another problem when I run:

ros2 launch rmf_demos_gz_classic office.launch.xml easy_fleet:=1

I get the next error:

[easy_fleet_adapter-16] Starting fleet adapter...
[easy_fleet_adapter-16] Traceback (most recent call last):
[easy_fleet_adapter-16]   File "/easy_ws/install/rmf_demos_fleet_adapter/lib/rmf_demos_fleet_adapter/easy_fleet_adapter", line 33, in <module>
[easy_fleet_adapter-16]     sys.exit(load_entry_point('rmf-demos-fleet-adapter', 'console_scripts', 'easy_fleet_adapter')())
[easy_fleet_adapter-16]   File "/easy_ws/build/rmf_demos_fleet_adapter/rmf_demos_fleet_adapter/easy_fleet_adapter.py", line 342, in main
[easy_fleet_adapter-16]     adapter = FleetAdapter(
[easy_fleet_adapter-16]   File "/easy_ws/build/rmf_demos_fleet_adapter/rmf_demos_fleet_adapter/easy_fleet_adapter.py", line 121, in __init__
[easy_fleet_adapter-16]     self.configuration = adpt.easy_full_control.Configuration.make(
[easy_fleet_adapter-16] AttributeError: type object 'rmf_adapter.easy_full_control.Configuration' has no attribute 'make'