ipa320 / ipa_coverage_planning

Algorithms for floor plan segmentation and systematic coverage driving patterns
254 stars 101 forks source link

I'm having some hard time #32

Open weicyingqiaopian opened 2 months ago

weicyingqiaopian commented 2 months ago

Hello, thank you for answering this question, I would like to ask how to add this to the move_base

ipa-rmb commented 2 months ago

For C++ Implementation to move_base check this code:

https://github.com/ipa320/ipa_coverage_planning/blob/f8a1dae4a09693f36a84fd92b6f9772d4c6faff1/ipa_room_exploration/ros/src/room_exploration_action_server.cpp#L707

and

https://github.com/ipa320/ipa_coverage_planning/blob/f8a1dae4a09693f36a84fd92b6f9772d4c6faff1/ipa_room_exploration/ros/src/room_exploration_action_server.cpp#L1037

weicyingqiaopian commented 2 months ago

Thank you for your answer, what should I do now, do I need to write the client to use it?

ipa-rmb commented 2 months ago

I think if you interface to your robot with move base, you just need to configure the coverage planner accordingly and activate that you want the coverage planner to control your robot. You can set this paramter in the config file to true, to have this behaviour: https://github.com/ipa320/ipa_coverage_planning/blob/f8a1dae4a09693f36a84fd92b6f9772d4c6faff1/ipa_room_exploration/ros/launch/room_exploration_action_server_params.yaml#L34

weicyingqiaopian commented 2 months ago

I've changed the execute_path: false parameter, but it hasn't changed

ipa-rmb commented 2 months ago

Ok, and you started the coverage program from the sample action client, rigth? The sample action client overwrites the path execution setting to false via dynamic reconfigure: https://github.com/ipa320/ipa_coverage_planning/blob/f8a1dae4a09693f36a84fd92b6f9772d4c6faff1/ipa_room_exploration/ros/src/room_exploration_action_client.cpp#L123

I would suggest: have a look into the code of the sample action client and adapt it to your needs. It might even just load a predefined map from our test set right now, and not use your own map. It is just an example. You can also just write a brief python script with an according call to the ipe_room_exploration action server. Then you have full freedom.

weicyingqiaopian commented 2 months ago

Should I just change this to true?

ipa-rmb commented 2 months ago

This would be an option. Anyways, please understand that the sample client is majorly written for people without a robot attached, it just demonstrates coverage planning based on database maps. There might be more adaptations needed to run the robot. As said, please quickly scan the code of the sample client with your application purpose in mind.

weicyingqiaopian commented 2 months ago

Thank you, you are really responsible, thank you for helping me, I don't know how to write a client that can implement the coverage path planning navigation of my own map

ipa-rmb commented 2 months ago

One thing I saw, that will definitely need correction, is how you provide the map to the algorithm. In the client, these lines read the map from a file: https://github.com/ipa320/ipa_coverage_planning/blob/f8a1dae4a09693f36a84fd92b6f9772d4c6faff1/ipa_room_exploration/ros/src/room_exploration_action_client.cpp#L68

ipa-rmb commented 2 months ago

The interface to the room exploration server is defined and explained here in this file: https://github.com/ipa320/ipa_coverage_planning/blob/f8a1dae4a09693f36a84fd92b6f9772d4c6faff1/ipa_building_msgs/action/RoomExploration.action#L1

weicyingqiaopian commented 2 months ago

Is there any example of client code?

ipa-rmb commented 2 months ago

Only the sample client you know in C++. Using this sample code and adapting it should be quite straightforward, it contains especially the ROS action call to the exploration server to start processing and optionally execute the trajectory following. ipa_coverage_planning/ipa_room_exploration/ros/src/room_exploration_action_client.cpp

weicyingqiaopian commented 2 months ago

I'm going to test it later, I just changed that parameter to true and it already works, thank you

weicyingqiaopian commented 2 months ago

I'm going to bother you again.,Mine doesn't seem to have obstacle avoidance anymore.,What's the reason for this.

ipa-foj commented 2 months ago

What exactly do you mean? Our code only provides the navigation goals, the obstacle avoidance needs to be handled by your move base instance you set up for the robot.

ipa-rmb commented 2 months ago

Our solution commands the navigation goals to move_base without checking whether they are accessible at this moment. However, we rely on move_base to return an error, if the pose can not be reached and then we command a nearby pose: https://github.com/ipa320/ipa_coverage_planning/blob/f8a1dae4a09693f36a84fd92b6f9772d4c6faff1/ipa_room_exploration/ros/src/room_exploration_action_server.cpp#L1116

If you like to do more fancy stuff, you can check the local obstacle map from move_base before commanding the path poses.

weicyingqiaopian commented 2 months ago

Excuse me again, I don't think it followed this path

weicyingqiaopian commented 2 months ago

微信截图_20240516171614 I don't feel like it's all covering my map, and some of the places don't seem to be planned right

weicyingqiaopian commented 2 months ago

Excuse me, w ![Uploading 1111111111111.png…]() hy do you go to the same place first every time you start, I'm curious because of what

ipa-foj commented 1 month ago

We go to the same place because we select the closest point of the path from the starting point given to the planner

weicyingqiaopian commented 1 month ago

How to make it a little away from the wall, close to the wall, it is easy to get stuck, and it can't be poured out before and after