Ask Your Question

How to navigate avoiding obstacles using an existing map generating from hector slam?

asked 2019-11-26 10:16:34 -0600

yosra gravatar image

I have a robot with 4 wheels and ydlidar x4 , succed to generate map and save it using hector slam mapping but not succeed to retrieve informations from the map to send motor commands via uart to the STM32 responsible of running the robot . Any suggestion how to do it (all tutorials found are for gmapping and not hector mapping)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-11-26 17:13:26 -0600

jordan gravatar image

A map is a map. Navigation does not care where it came from (could be gmapping, hector, or other). You should follow the instructions for setting up Navigation:

edit flag offensive delete link more


Setting the navigation require odometry no ? and just i'm using hector mapping with laser scan . Another question for my real robot I have raspberry pi 3B to interact with stm32 via uart , have to send a caracter to the STM for example "F" to move forword "B" to move back etc...How could i retrieve information from map to go from A to B and how could I use that information to send it via uart ?

yosra gravatar image yosra  ( 2019-11-27 02:50:13 -0600 )edit

You can get odometry from hector mapping, although it is more robust to derive this from your robot wheels (eg. using motor shaft encoders or encoder-free odometry with stepper motors.

To get odomentry from hector, see:

~pub_map_odom_transform (bool, default: true)

Determine if the map->odom transform should be published by the system.

To go from A to B using ROS, the correct approach is to use the Navigation package. To control your robot you will need to implement a node that subscribes to the 'cmd_vel' topic. This node will listen for commands from the Navigation package and respond by generating the "F", "B", etc. accordingly. Sending characters over a UART using Raspberry Pi is very well documented in many places on the internet.

jordan gravatar image jordan  ( 2019-11-27 08:42:05 -0600 )edit

Thank you for answring,moreover i,ll use hector navigation downloading the packgage from git then trying to build a lot of errors appeared for hector_gps_mapping node telling that ceres_catkine not found and then tf not declared

yosra gravatar image yosra  ( 2019-11-27 10:00:17 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2019-11-26 10:16:34 -0600

Seen: 201 times

Last updated: Nov 26 '19