You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _docs/tutorials/demos/crazyflie_demo/index.md
+2-295Lines changed: 2 additions & 295 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,298 +5,5 @@ redirect_from:
5
5
- /crazyflie_demo/
6
6
---
7
7
8
-
This demo aims to expose a **micro-ROS** use case. It runs on a pair of embedded devices:
9
-
a [**Crazyflie 2.1**](https://www.bitcraze.io/crazyflie-2-1/) drone, used as a user controller,
10
-
and a [**Kobuki Turtlebot 2**](https://www.turtlebot.com/turtlebot2/) as a mobile and controlled device.
11
-
12
-

13
-
14
-
Both of them rely on **micro-ROS** publication and subscription mechanisms and use an underlying [**Micro XRCE-DSS client**](https://micro-xrce-dds.readthedocs.io/en/latest/).
15
-
16
-
This demo also includes conventional ROS 2 tooling as a demonstration of integration with **ROS 2**. We use Gazebo, RVIZ and simple ROS 2 nodes (aka **external nodes**) acting as data converters.
17
-
18
-
This demo was developed taking as base the [Kobuki demo](/docs/tutorials/demos/kobuki_demo).
The proposed demo is composed of different kind of messages and topics.
35
-
36
-
The **Crazyflie 2.1** drone relies on [ST STM32F405](https://www.st.com/en/microcontrollers-microprocessors/stm32f405-415.html) MCU running **[FreeRTOS](https://www.freertos.org/)**. Using the RTOS capabilities and the integrated radio communication device, the drone can run a node that publishes:
37
-
- its own relative position as a 3D vector (X, Y and Z) using a *geometry_msg/Point32* message type on */drone/odometry* topic.
38
-
- its own attitude as a 3D vector (pitch, roll and yaw) using a *geometry_msg/Point32* message type on */drone/attitude* topic.
39
-
40
-
The **Kobuki Turtlebot 2** robot is controlled using a UART protocol through a custom DB25 connector. The micro-ROS node runs on an Olimex STM32-E407 board attached to that UART port. This hardware features a [ST STM32F407](https://www.st.com/en/microcontrollers-microprocessors/stm32f407-417.html) MCU running **[Nuttx](https://nuttx.org/)** RTOS. In the same way, this node can communicate with the robot (UART) and with the ROS2 world (integrated Ethernet). Its used topics are:
41
-
- a subscription on */cmd_vel* topic (*geometry_msg/Twist* message type) to receive the controlling angular and linear velocity.
42
-
- a publication on */robot_pose* topic (*geometry_msg/Vector3* message type) which includes X position, Y position and robot yaw.
43
-
44
-
The **external ROS 2 nodes** are rclpy tools with some different functionalities:
45
-
-*attitude_to_vel.py*
46
-
- Converts Crazyflie */drone/attitude* to Kobuki Turtlebot 2 */cmd_vel* so that drone pitch is mapped to robot linear velocity and drone roll to angular valocity.
47
-
- Converts Crazyflie publications on */drone/attitude* and */drone/attitude* topics to *tf2_msgs/TFMessage* messages (required by RVIZ visualizer)
48
-
-*odom_to_tf.py*
49
-
- Converts Kobuki Turtlebot 2 publications on */robot_pose* topic to *tf2_msgs/TFMessage* messages (required by RVIZ visualizer).
**micro-ROS Agent** should receive an incoming client connection and */robot_pose* topic should be published. Check it with `ros2 topic echo /robot_pose`
253
-
254
-
## Run Crazyflie 2.1 Node
255
-
256
-
Connect Crazyradio PA 2.4 GHz USB dongle and turn on Crazyflie 2.1 drone.
257
-
258
-
Run the Crazyflie Client + Bridge:
259
-
```
260
-
cd crazyflie-clients-python
261
-
python3 bin/cfclient
262
-
```
263
-
264
-
This command should open the Crazyflie Client and print a serial device path in the terminal (something like /dev/pts/0).
265
-
266
-
Run (in another prompt) a **Micro XRCE-DDS Agent**:
267
-
```
268
-
MicroXRCEAgent serial --dev [serial device]
269
-
```
270
-
271
-
**Micro XRCE-DDS Agent** should receive an incoming client connection and */drone/attitude* and */drone/position* topics should be published. Check it with `ros2 topic echo /drone/attitude` and `ros2 topic echo /drone/position`
0 commit comments