###### tags: `ROS1` `Jetson nano`
# Jetfalcon and Navigation
Before the navigation, you need to make a map.
If you had not done the step, please go to the last unit: [2. Jetfalcon and SLAM](https://hackmd.io/@weichih-lin/jetfalcon_slam).
## Hardware you need to prepare
A mobile platform with differential drive configuration.
If you don't have any idea, please check more information from [Jetfalcon](https://hackmd.io/@weichih-lin/jetfalcon).
[](https://www.icshop.com.tw/product-page.php?27398)
Also, recommand using host machine to launch the SLAM. If can, please prepare another host machine with ROS-Melodic.
You can check this see how to install ROS on the host machine: [ROS Installation](http://wiki.ros.org/melodic/Installation/Ubuntu).
Next, build the workspace for project jetfalcon. You can check it to see how to build: [0. Jetfalcon and setup environment](https://hackmd.io/WXLzPFNxR3mEptc4_4svhw?view#5-Save-the-map-through-package-map_server).
OK! Let's use navigate the robot!
## 1. Prepare the ground for navigation
We will use the "existed map" to navigate the robot. Please prepare the ground depend on your map for navigation
Here is an example ["test"](https://hackmd.io/WXLzPFNxR3mEptc4_4svhw#5-Save-the-map-through-package-map_server):

In the example "test", there is a box behind the Jetfalcon and also is the starting point. Another box far away from the Jetfalcon is the destination. Sure, the actual destination is the point in fron of the box, not the box's location.
If you have done it, then we can go to the next step.
## 2. Bringup the Jetfalcon
The motion "bringup" is activating all sensors and motors on the Jetfalcon. After the motion bringup, means that the Jetfalcon is ready to publish datas form sensors and subscribe datas from others' topic amd more about communication of ROS.
Please type the command below on the Jetfalcon
```bash=
roslaunch jetfalcon_bringup bringup.launch
```

And then you can see the lidar rotating. **Notice! Don't move the Jetfalcon manually or the odometry will be out of action while lidar rotating!**
## 3. Launch the file to navigate the robot
Now the Jetfalcon is publishing topics from sensors. Please type the command below on the host machine:
```bash=
roslaunch jetfalcon_nav navigation.launch map_file:=$map_name.yaml open_rviz:=true local_planner:=dwa
```
Variable "$map_name" must be typed by the name you want.
For this example, using the name "test" to load the map.
And variable local_planner defaul is "dwa", you also can use "teb" local_planner to navigate the robot.

After typing the code, you can see the rviz with default setting.

You also can remove the "global_costmap" and "local_costmap" to see the static map.

Great! Next we must assign the location of the robot to the ROS. Please click the function "2D Pose Estimate" on the top, you will see a small green arrow under the mouse. Next, press the point of the location robot at on the map and move your mouse to assign the direction of the robot. After finish assigning the direction, you can release the mouse.

Finally, you can click the function "2D Nav Goal" on the top and you will see a small purple arrow under the mouse. Next, press the point of the goal on the map and move your mouse to assign the direction while the robot stop at gaol.

Awesome! Now release the mouse and you will see the robot start going to the gaol.
This is the simple example for navigating the robot. Please subscribe my notes to get more example for ROS and ROS2!