Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to specify parking waypoint for ParkRobotIndefinitely request factory #115

Open
1 task done
CarlyyyChen opened this issue Mar 19, 2024 · 2 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@CarlyyyChen
Copy link

Before proceeding, is there an existing issue or discussion for this?

OS and version

Ubuntu 22.04

Open-RMF installation type

Source build

Other Open-RMF installation methods

No response

Open-RMF version or commit hash

2.0.3

ROS distribution

Humble

ROS installation type

Source build

Other ROS installation methods

No response

Package or library, if applicable

No response

Description of the bug

I want to make some changes in ParkRobotFactory class (currently it is using dedicated_charging_waypoint when a parking waypoint is not passed in, I want to change it to a dedicated parking waypoint so that the robot will be able to park at a dedicated parking waypoint instead of its charger). In order to make that change, I have cloned the rmf_task package from your repo to local, together with your rmf_demos codes, and all packages are building fine. However, when I use ros2 launch rmf_demos_gz_classic office.launch.xml to launch your office demo, all navigation paths are not showing up in Rviz, and the robot is not spawned in the map either. In terminal there is a relevant error message as below.

[fleet_adapter-16] ImportError: /opt/ros/humble/lib/librmf_fleet_adapter.so: undefined symbol: _ZN8rmf_task4Task7BookingC1ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENSt6chrono10time_pointINS8_3_V212steady_clockENS8_8durationIlSt5ratioILl1ELl1000000000EEEEEESt10shared_ptrIKNS_8PriorityEERKS7_SG_b
[ERROR] [fleet_adapter-16]: process has died [pid 8350, exit code 1, cmd '/home/agsw/Desktop/teabot-http/install/rmf_demos_fleet_adapter/lib/rmf_demos_fleet_adapter/fleet_adapter -c /home/agsw/Desktop/teabot-http/install/rmf_demos/share/rmf_demos/config/20th_floor/tinyRobot_config.yaml -n /home/agsw/Desktop/teabot-http/install/rmf_demos_maps/share/rmf_demos_maps/maps/20th_floor/nav_graphs/0.yaml -sim --ros-args --params-file /tmp/launch_params_93ybb49j --params-file /tmp/launch_params_d36yp8ry'].

The local rmf_task package shall take priority over the underlay workspace (/opt/ros/humble). And I have tried to clone rmf_fleet_adapter_python package locally with the rmf_demos packages, it is working fine (builds fine, and Rviz launches fine). The issue is only with the rmf_task package. Hope you can shed some light on above error. Suggestions on other approaches to implement that change to ParkRobotFactory class are also welcome! Thanks much in advance.

Steps to reproduce the bug

  1. clone rmf_demos codes
  2. close rmf_task package, put it alongside with other packages in rmf_demos
  3. colcon build, and source install/setup.bash
  4. ros2 launch rmf_demos_gz_classic office.launch.xml to launch the office demo
  5. navigation paths and robots are not showing up in Rviz

Expected behavior

No response

Actual behavior

No response

Additional information or screenshots

This is the file structure in my workspace.
image

@Yadunund
Copy link
Member

Hi @CarlyyyChen,

Thanks for highlighting your problem.

Your experience highlights a problem in our EasyFullControl implementation which is used by the robot fleets in rmf_demos. See rmf_demos_fleet_adapter.

The issue is that as seen in the implementation linked above, we construct the ParkRobotIndefinitely factory without passing in a parking_waypoint. As a result, the default std::nullopt is passed which sets the parking waypoint as the charger waypoint and the robot always goes to it's charging waypoint assigned to the robot in the fleet config.

Here's my proposal for a more proper fix:

  1. Update the rmf_task::State class to get/set a dedicated_parking_waypoint field similar to the existing dedicated_charging_waypoint.
  2. Add a parking field to the config similar to charger.
  3. Add std::vector<std::size_t> parking_waypoints to EasyFullControl::RobotConfiguration. And have EasyFullControl::Configuration::from_config_file to parse the parking field from the config and append the right waypoint to RobotConfiguration.
  4. Add a RobotUpdateHandle::set_parking_waypoint() API here.
  5. Take the parking waypoint form the RobotConfig and set it for the RobotUpdateHandle returned FleetUpdateHandle::add_robot() is called here
  6. Update RobotContext to make and get an rmf_task::State with the dedicated_parking_waypoint property
  7. Finally, update the ParkRobotIndefinitely::make_request() to actually plan to the state.dedicated_parking_waypoint()

@mxgrey @arjo129 I think this approach might play nicely with the Reservation system integration but please share otherwise!

@Yadunund Yadunund changed the title [Bug]: colcon build is fine but Rviz does not launch with nav graph and spawned robot with local changes Unable to specify parking waypoint for ParkRobotIndefinitely request factory Mar 20, 2024
@CarlyyyChen
Copy link
Author

Hi @Yadunund thanks for suggesting the plan. It is exactly the same as I have planned. But I was stuck at the very first step -- adding rmf_task package to local in order to change it. Appreciate if you can advise more on the ImportError and issue with Rviz!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants