DaniGarciaLopez / ros2_explorer

In this repo we use Turtlebot 3 along with ROS 2 and Gazebo to explore an unknown csv environment, navigate through it and create a map
88 stars 21 forks source link

Can't run the explorer with my own map #9

Closed cataclism closed 5 months ago

cataclism commented 1 year ago

Hi!

I'm trying to run the explorer on this map: turtlebot3_big_house.zip

I haven't been able to modify the launch file to launch my own map and what happens now is that i launch the map in gazebo with: ros2 launch turtlebot3_gazebo turtlebot3_big_house.launch.py

then i launch nav2 in slam mode ros2 launch turtlebot3_navigation2 navigation2.launch.py use_sim_time:=True slam:=True

and then your explorer: ros2 run explorer_bringup manager

choosing Wanderer and what I get is

[INFO] [1693477736.178197689] [manager]: Waiting for action server...

What can I do? I can't manage to modify properly files, could you help me please? I'm a noob ;(

DaniGarciaLopez commented 1 year ago

Discoverer and Wanderer are implemented as action server so you need to launch the server to be able to select it from the manager. According to the launch files you're using I don't think you're executing them, in map10.launch.py we launch them here.

cataclism commented 1 year ago

HI! I've managed to modify the launch file with you pointed me at with the map I need to use. Now if I launch the explorer as output I get:

[INFO] [1693557828.802486099] [manager]: Waiting for action server... [INFO] [1693557828.804563193] [manager]: Sending discoverer goal request... [INFO] [1693557828.805183181] [manager]: Discovering until 97% map completed [INFO] [1693557828.813911938] [manager]: Exploration goal accepted [INFO] [1693557831.594716831] [manager]: Goal failed with status: 6 [INFO] [1693557831.935747908] [manager]: Duration: 5 s - Map: 0.01 - Distance: 0.03 m

and everything is freezed.

If I kill the explorer the turtlebot goes straight and crashes against the wall. Do you have any idea why and how could i solve this?

DaniGarciaLopez commented 1 year ago

Hi,

If you're using the manager node, you need a way to track when the map is finished. In our repository, we use the node watchtower to figure out what parts of the map are still unexplored, based on the CSV map's data. If you're using your own map, you'll have to tweak it to calculate the initial map size.

If you're just interested in using the exploration algorithms, Discoverer and Wanderer have been designed as action servers. Adapting them for your needs shouldn't be too hard, but you might need to make some adjustments.