Robotics StackExchange | Archived questions

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

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)

Asked by yosra on 2019-11-26 11:16:34 UTC

Comments

Answers

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:

http://wiki.ros.org/navigation/Tutorials/RobotSetup

Asked by jordan on 2019-11-26 18:13:26 UTC

Comments

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 ?

Asked by yosra on 2019-11-27 03:50:13 UTC

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.

Asked by jordan on 2019-11-27 09:42:05 UTC

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

Asked by yosra on 2019-11-27 11:00:17 UTC