|
|
[[_TOC_]]
|
|
|
* [Intro](#intro)
|
|
|
* [Input](#input)
|
|
|
* [Output](#output)
|
|
|
* [Quickstart](#quickstart)
|
|
|
* [Velocity Commmander](#velocity-commmander)
|
|
|
* [Full Setup](#full-setup)
|
|
|
* [Launch System](#launch-system)
|
|
|
* [Entry Launchfiles](#entry-launchfiles)
|
|
|
* [General Launchfile](#general-launchfile)
|
|
|
* [Results {.tabset}](#results-tabset)
|
|
|
* [Plots](#plots)
|
|
|
* [Tables](#tables)
|
|
|
|
|
|
# Intro
|
|
|
|
|
|
This package is used to control the landing on the (moving) aruco marker.
|
|
|
This package is used to control the landing on the (moving) aruco marker. It consists of two cascaded nodes: The `velocity_controller` and the `velocity_commander`. Their interdependence is shown in the figure below.
|
|
|
|
|
|
```mermaid
|
|
|
graph LR
|
|
|
E( )
|
|
|
A( )
|
|
|
B( )
|
|
|
C( )
|
|
|
|
|
|
subgraph landing_controller
|
|
|
velocity_controller
|
|
|
velocity_commander
|
|
|
end
|
|
|
|
|
|
D( )
|
|
|
|
|
|
|
|
|
A-->|pos. of aruco marker|velocity_controller
|
|
|
B-->|attitude of pixhawk|velocity_controller
|
|
|
C-->|proportional gain|velocity_controller
|
|
|
velocity_controller-->|velocity command|velocity_commander
|
|
|
E-->|PX4 time synchronisation|velocity_commander
|
|
|
velocity_commander-->|command to pixhawk|D
|
|
|
|
|
|
classDef empty fill:#fff,stroke:#fff
|
|
|
class A,B,C,D,E empty
|
|
|
```
|
|
|
|
|
|
The `velocity_controller` uses the position of the aruco marker relative to the camera and the current position of the pixhawk to build up an internal transformation tree (see tbd). This tree is used to estimate the position of the drone, relative to the aruco marker. This leads to the control deviation which is the input to the controller. The controller itself is designed as a proportional controller which the gain `1.0`. The gain can be adjusted by publish a float value to the given topic. The controller output is then send to the `velocity_commander`. This node fits the commanded velocity into the PX4 internal datastructure for instrumenting its base controllers. \
|
|
|
**Note:** The existence of two nodes for this packages has evolved during their development. To keep a better overview and to avoid delays due to interprocess communication, the two nodes could be merged into a single one.
|
|
|
|
|
|
## Input
|
|
|
|
|
|
TODO
|
|
|
**Topics**
|
|
|
|
|
|
* Transformations: `/tf` (for details, see below)
|
|
|
* Estimated Attitude of Pixhawk: `/VehicleAttitude_PubSubTopic` (therefore, micrortps must be running)
|
|
|
* Proportional Controller gain: `/landing_controller/p_gain`
|
|
|
* PX4 Time synchronisation: `/Timesync_PubSubTopic`
|
|
|
|
|
|
**Transformations**
|
|
|
|
|
|
* `camera` -> `aruco_marker`
|
|
|
|
|
|
**Parameters** \
|
|
|
Currently, all parameters are set as constants within the python source code and the beginning of each node class. In the future, the [ROS2 Parameter service](https://docs.ros.org/en/foxy/Tutorials/Parameters/Understanding-ROS2-Parameters.html) should be used. The following parameters need to be considered:
|
|
|
|
|
|
`velocity_controller`:
|
|
|
|
|
|
* Transform from pixhawk to camera (`TF_PIX_TO_CAMERA`)
|
|
|
* Controller gain (`gains`)
|
|
|
|
|
|
`velocity_commander`:
|
|
|
|
|
|
## Output
|
|
|
|
|
|
TODO
|
|
|
**Topics**
|
|
|
|
|
|
* Transformations: `/tf` (for details, see below)
|
|
|
* Commanded velocity: `/TrajectorySetpoint_PubSubTopic`
|
|
|
|
|
|
**Transformations**
|
|
|
|
|
|
* `map` -> `ned_debug`
|
|
|
* `map` -> `camera_debug`
|
|
|
* `map` -> `pixhawk_debug`
|
|
|
* `map` -> `aruco_marker_debug`
|
|
|
|
|
|
These transformations should not be used for further processing. Their purpose is to supervise the internal transformation tree.
|
|
|
|
|
|
# Quickstart
|
|
|
|
|
|
## Simulation
|
|
|
As explained in the [introduction](#intro), this package consists of two nodes. In the following, quickstart guides for only using the `velocity_commander` and for using the full setup are given. These are prepared to work only in a gazebo simulation. For an execution on the target hardware, see [Launch System](#launch-system).
|
|
|
|
|
|
To run the landing_controller with the gazebo simulation, open a terminal window. Navigate to the `PX4-Autopilot` directory and start the Autopilot:
|
|
|
## Velocity Commmander
|
|
|
|
|
|
```
|
|
|
To test the `velocity_commander` with the gazebo simulation, open a terminal window. Navigate to the `PX4-Autopilot` directory and start the Autopilot:
|
|
|
|
|
|
```plaintext
|
|
|
make px4_sitl_rtps gazebo
|
|
|
```
|
|
|
|
|
|
Then open another terminal and launch the corresponding ROS2 launch file:
|
|
|
wait until the PX4 is fully started and then start the micrortps handler on the PX4 side by typing:
|
|
|
|
|
|
```plaintext
|
|
|
micrortps_client start -t UDP &
|
|
|
```
|
|
|
ros2 launch landing_controller simulation.launch.py
|
|
|
|
|
|
Then open another terminal and launch the corresponding ROS2 launch file:
|
|
|
|
|
|
```plaintext
|
|
|
micrortps_agent start -t UDP &
|
|
|
ros2 run landing_controller velocity_commander
|
|
|
```
|
|
|
For more information about what this launch file does, see [Launch System](Packages/landing_controller/2_Launch System).
|
|
|
|
|
|
This start the micrortps handler for ROS and the `velocity_commander` node.
|
|
|
|
|
|
Finally, open a third and terminal and type:
|
|
|
```
|
|
|
|
|
|
```plaintext
|
|
|
ros2 run teleop_twist_keyboard teleop_twist_keyboard
|
|
|
```
|
|
|
|
|
|
If an error occurs, this package is probably not installed. To fix this, type:
|
|
|
```
|
|
|
|
|
|
```plaintext
|
|
|
sudo apt-get install ros-$ROS_DISTRO-teleop-twist-keyboard
|
|
|
```
|
|
|
|
|
|
Once the node is started, the avaible keys to control the drone are presented. For the current setup, the Holonomic mode must be used by pressing the shift key. When now applying the shown controls, the drone moves in the gazebo environment according to these commands.
|
|
|
|
|
|
## Full Setup
|
|
|
|
|
|
# Launch System
|
|
|
|
|
|
The launch system currently consists of three files in the [corresponding directory](https://git.tu-berlin.de/eriksuer/specialtopics/-/tree/main/src/landing_controller/launch). Their interdependence is shown by the following graph:
|
... | ... | @@ -48,8 +136,14 @@ graph TD; |
|
|
realworld.launch.py-->general.launch.py;
|
|
|
```
|
|
|
|
|
|
**Note:** In a future version, the launchfiles could be reduced to a single launch file which is controlled by command line arguments.
|
|
|
|
|
|
## Entry Launchfiles
|
|
|
The launch files that are supposed to be called using `ros2 launch` are `simulation.launch.py` and `realworld.launch.py`. Both of them start the `micrortps_agent`, but with different parameters. While the simulation launcher starts it on the UDP port, the realworld launch file accesses the serial port `ttyUSB0`. After setting up the RTPS connection, both launch files call `general.launch.py`.
|
|
|
|
|
|
The launch files that are supposed to be called using `ros2 launch` are `simulation.launch.py` and `realworld.launch.py`. Both of them start the `micrortps_agent` (see [RTPS Communication](/eriksuer/specialtopics/-/wikis/hardware/rtps-communication), but with different parameters. While the simulation launcher starts it on the UDP port, the realworld launch file accesses the serial port `ttyUSB0`. After setting up the RTPS connection, both launch files call `general.launch.py`.
|
|
|
|
|
|
## General Launchfile
|
|
|
This launch file starts all nodes which are independent of the environment (i.e. simulation or realworld). At first the `velocity_commander` is started. Afterwards the launch file calls the rosbag to record all necessary topics. Therefore, the `VelocityCommander` class is examined and all topics which communicate with it are added to the list with the recorded topics. |
|
|
\ No newline at end of file |
|
|
|
|
|
This launch file starts all nodes which are independent of the environment (i.e. simulation or realworld). At first the `velocity_controller` and `velocity_commander` are started. Afterwards the launch file calls the rosbag to record all necessary topics. Therefore, the `VelocityCommander` class is examined and all topics which communicate with it are added to the list with the recorded topics.
|
|
|
|
|
|
You can turn parallel sections to tabs in `html_document` output. |
|
|
\ No newline at end of file |