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

[Legacy] ROS 1 Wiki out of date #184

Open
KatherineJames opened this issue Jun 17, 2024 · 1 comment
Open

[Legacy] ROS 1 Wiki out of date #184

KatherineJames opened this issue Jun 17, 2024 · 1 comment

Comments

@KatherineJames
Copy link

Description

ROS 1 wiki is out of date. I will update the wiki in a few days under section 'Quick Topological Navigation in simulation tutorial'.

@KatherineJames
Copy link
Author

Proposed update:

Getting started tutorial in simulation (ROS 1)

A tutorial on getting started with topo-nav in ROS 1 using the Riseholme vineyard_demo and thorvald simulator.

Set up a simulation:

We have a dockerized simulation available, or please use your own:
https://github.com/LCAS/bacchus_lcas/wiki/Phenorob-2021-Setting-Up

roslaunch ./vineyard_demo.launch launch_move_base:=true

Topological navigation (in simulation):

Setup simulation with topo-nav:

  • git clone https://github.com/LCAS/topological_navigation into src
  • checkout bacchus branch for melodic (or noetic, use git branch -a)
  • catkin_make
  • sudo apt-get install ros-melodic-mongodb-store ros-melodic-rospy-message-converter

Topological map file creation:

  1. A metric map is required as a pre-requisite:

    Resource: https://github.com/LCAS/bacchus_lcas/wiki/Phenorob-2021-Activities

    Use gmapping or slam to create a metric map:

     roslaunch bacchus_slam hector_slam.launch
     roslaunch  bacchus_slam throvald_teleop.launch
     rosrun map_server map_saver -f my_map
    

    Note: to navigate using teleop, you must be clicked on the terminal. Use keys to drive, i is forward,l/j make it spin.

    Note2: map_saver doesn’t take too long - something may be wrong in the running of the slam script if it does. This outputs a yaml and a pgm where the line was run. Place these in bacchus_lcas/bacchus_slam/maps.

  2. Create the .tmap2 file:

    We now need to collect x,y,z positions for nodes and create .tmap2 file:

    Update ~/row_ws/src/bacchus_lcas/bacchus_slam/launch/amcl_localization.launch to use nav_map_yaml=my_map.yaml

     roslaunch bacchus_slam amcl_localization.launch
     rostopic echo /clicked_point
    

    Use the Publish Point tool in Rviz to click where you want nodes, these will be output to the terminal.

    Copy the template from: https://github.com/LCAS/environment_common/blob/main/environment_common/convertors/templating/tmap.py

    Modify this file to use the node values you have just received from /clicked_point. The first line should be meta:
    Note: {location} and {gentime} can be any strings and this file is EXTREMELY case and space sensitive!

Launch and visualise the topological map

Modify vineyard_demo.launch to use my_map.yaml.

  1. View topological map in Rviz

Then:

roslaunch ./vineyard_demo.launch launch_move_base:=true
rosrun topological_navigation map_manager2.py demo.tmap2 # publishes the file to a rostopic
rosrun topological_navigation topological_transform_publisher.py
rosrun topological_navigation visualize_map2.py

In Rviz:

  • Add markerarray: topological_map_visualisation
  • Add markerarray: topological_route_visualisation
  • NB: if you messed up the positions, they may be off the map.
  • Add interactivemarkers for go_to_node/update (add direction arrows to the nodes)

You can add edges:

rosservice call /topological_map_manager2/add_edges_between_nodes “
origin: node0
destination: node1
action: move_base
edge_id: stringid”

If edges should be bi-directional, another edge will need to be added with origin: node1, destination: node0.

And save the updates: rosservice call /topological_map_manager2/write_topological_map "filename: '`pwd`/updated.tmap2'"

  1. Use the topological map for navigation:

    rosrun topological_navigation localisation.py
    rosrun topological_navigation navigation.py

Clicking on the interactive markers should now produce a path along the edge, and the robot should move from one node to the other.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant