|
|
|
## Setup workspace
|
|
|
|
First, create a catkin workspace
|
|
|
|
```shell
|
|
|
|
mkdir -p ardupilot_ws/src
|
|
|
|
cd ardupilot_ws
|
|
|
|
catkin init
|
|
|
|
cd src
|
|
|
|
```
|
|
|
|
Clone the reprository
|
|
|
|
|
|
|
|
## Launch SITL Instance
|
|
|
|
Then, launch a SITL instance:
|
|
|
|
```shell
|
|
|
|
sim_vehicle.py -v ArduCopter --console --map
|
|
|
|
```
|
|
|
|
|
|
|
|
Now you got an SITL instance launched with TCP and UDP access, you should have some line like:
|
|
|
|
```shell
|
|
|
|
"mavproxy.py" "--master" "tcp:127.0.0.1:5760" "--sitl" "127.0.0.1:5501" "--out" "127.0.0.1:14550" "--out" "127.0.0.1:14551" "--map" "--console"
|
|
|
|
```
|
|
|
|
Both “–out” refer to UDP connexion create by MAVProxy. We will use UDP access with mavros.
|
|
|
|
|
|
|
|
Get back to your ROS terminal. Let’s create a new directory for our launch file.
|
|
|
|
```shell
|
|
|
|
mkdir launch
|
|
|
|
cd launch
|
|
|
|
roscp mavros apm.launch apm.launch
|
|
|
|
```
|
|
|
|
Edit the launch file with correct **fcu_url**
|
|
|
|
```shell
|
|
|
|
nano apm.launch
|
|
|
|
<arg name="fcu_url" default="udp://127.0.0.1:14551@14555" />
|
|
|
|
```
|
|
|
|
Launch it with:
|
|
|
|
```shell
|
|
|
|
roslaunch apm.launch
|
|
|
|
```
|
|
|
|
## Launch ROS node
|
|
|
|
source you setup.bash
|
|
|
|
```shell
|
|
|
|
source <WORKSPACE_PATH>/devel/setup.bash
|
|
|
|
rosrun droneoa_ros droneoa_ros
|
|
|
|
``` |
|
|
|
\ No newline at end of file |