Navigation [Melodic]
Navigation using R1mini on ROS1 Melodic.
Last updated
Navigation using R1mini on ROS1 Melodic.
Last updated
To begin autonomous navigation, enter the below line to the command line.
Running the above command, you should get terminal output similar to the image below.
Just like SLAM, to see the rviz visualization in action, run the below line in the terminal shell.
Running the above code, an rviz GUI should appear and show an image similar to the above.
At the top left of the rviz GUI, press "2D Pose Estimate". This will allow you to select the approximate position of the robot with respect to the map.
Once the robot is roughly aligned to the map, press "2D Nav Goal" and then choose lect the location and orientation of the desired endpoint on the map. The robot will perform autonomous navigation and path planning from the current pose to the desired end pose. The process should look like the images below.
Alternatively, we can use Python code to tell our robot which pose to end at. Jupyter Notebook will be used for the demo.
First, turn on Jupyter Notebook by running the below command in terminal.
First, enter the below lines into the code block to import all the necessary files and modules.
Next, initialize the rosnode and actionlib.
On a separate terminal window, run the below line to get the current position of the robot on the map. The image below is an example output.
Next, intialize and select an end position for the robot's navigation.
Alternatively, we can determine the angles at which the robot should move at using quaternions
Lastly, we start navigation with the below line.
To see a video demonstration of this page, check this video here: https://www.youtube.com/watch?v=mIw8EjJsa9E