How could I navigate with a real robot
Hello, I have a robot with 4 wheels and laser sensor ydlidar x4 , succeed to build the map with hector slam , now I don't know what to do to navigate using a static map from the actual position to B position , the robot (raspberry pi 3B) is connected via UART to an stm32 responsible for running the robot i have to send 4 caracters : "F" for front , "B" for back , "R" for right and "L" for left
Any one have any idea?
Asked by yosra on 2019-11-29 11:09:14 UTC
Answers
You have to look at the navigation stack, but you have already done it because Hector slam is working. With r viz you can set the goal
Asked by duck-development on 2019-11-29 12:17:24 UTC
Comments
The navigation stack is for moving a robot and Hector Slam is to create a map and localize a robot so I don't see why you conclude OP is using the navigation stack.
Asked by Delb on 2019-12-02 03:03:11 UTC
Yes! in fact hector slam is working, but with a real robot i have to communicate with the controller in stm32 , I don't know the implementation done but just I have to send via UART a char "f" for forwad, "b" for back "r" for right and "l" for left don't know how to translate the velocity commnad to such information used by the robot
Asked by yosra on 2019-12-02 03:44:51 UTC
You write a node witch is subscribing the twis topic and read the data und send as a response some uart megs to you stm32 over uart
Asked by duck-development on 2019-12-03 13:22:31 UTC
@billy 's questions are relevant, please edit your questions to add the answers (even if you can't answer every question). The most important one is :
Can you both turn and move forward at the same time?
You can use the navigation stack to generate trajectories without moving your robot thanks to the service make_plan
, that will return a path (i.e. a list of poses). Since you can only use 4 commands you can call the service to get the positions and then try to reach each of them. Since you said you are using a map previously created, you need to use AMCL to get the position of the robot. By comparing the robot pose with the goal you have to reach you could decide in which direction your robot has to move. You can then decide to have a goal tolerance to decide to reach the next goal.
Asked by Delb on 2019-12-02 04:39:00 UTC
Comments
The robot can't turn just moving to 4 directions (F,L,R,B)
Asked by yosra on 2019-12-02 05:19:32 UTC
Oh so that's a holonomic robot ? Eventhough it can't turn, can it go to the left (or right) and forward at the same time ?
Asked by Delb on 2019-12-02 05:31:21 UTC
No it can't , eventually one action will perform first , if we send Left and right at the same time one action will execute first and then the second.
Asked by yosra on 2019-12-02 05:37:50 UTC
And can you change this behavior ? That's not optimal at all, but you should still be able to navigate doing as I suggested. If you can change this then refer to @billy 's comment to be able to use the navigation stack.
Asked by Delb on 2019-12-02 05:47:24 UTC
How could I run AMCL for localisation ? I'm using hector slam to build the map my approch: 1/run the map server 2/rosrun amcl scan:=base_scan
Asked by yosra on 2019-12-02 09:51:22 UTC
You could use a launch file to have all the AMCL parameters set but that's indeed the two required nodes for the localization with AMCL.
Asked by Delb on 2019-12-02 10:24:46 UTC
Ok thank you i'll try your approach
Asked by yosra on 2019-12-02 11:07:10 UTC
Comments
You have some work left to do before your can use navigation stack. Since you only send F,B,R,L to controller maybe a lot of work left.
Do you get any feedback from the wheels from an encoder, or maybe you are using stepper motors where you can directly control the number of steps/second?
Can you control the rate of spin on the wheels?
Can you both turn and move forward at the same time?
Navigation stack assumes you have the capability to steer your robot while moving and have some control over the speed of the robot. Navigation stack will output a velocity command and a rotate command(at the same time) and you'll need to translate that command into some your controller can use.
For wheel feedback the standard use is odometry data from encoders, but there are a couple alternate ways to get that odometry data. One way is to use laser scan matcher and another is if you are using steppers and your controller is capable of reporting total number of steps taken.
Asked by billy on 2019-11-29 19:31:10 UTC