|
1 | | -micro-ROS |
| 1 | +# STM32F407G-Discovery1 Micro-ROS Extension |
| 2 | +Test conditions : |
| 3 | + ROS2 : dashing |
| 4 | + Board : STM32F407G-Dis1 |
| 5 | + Hardware link : CP210x UART Bridge (through UART2) |
| 6 | + Apps : int32_publisher, ping_pong |
| 7 | + |
| 8 | +Before running this, make sure micro-ROS is built and sourced correctly |
| 9 | +### 1. Create |
| 10 | +``` |
| 11 | +ros2 run micro_ros_setup create_firmware_ws.sh freertos stm32f4_disco |
| 12 | +``` |
| 13 | +This will create the firmware folder, if all extensions are not present you can download from the concerning repo |
| 14 | +### 2. Configure |
| 15 | + |
| 16 | +``` |
| 17 | +ros2 run micro_ros_setup configure_firmware.sh <app_name> --transport serial --dev 2 |
| 18 | +``` |
| 19 | +### 3. Build |
| 20 | +This will first build microros followed by the board firmware |
| 21 | +``` |
| 22 | +ros2 run micro_ros_setup build_firmware.sh |
| 23 | +``` |
| 24 | + |
| 25 | +### 4. Flash |
| 26 | +``` |
| 27 | +ros2 run micro_ros_setup flash_firmware.sh |
| 28 | +``` |
| 29 | +Flashing is done via st-link but it can be changed to other methodes in the config |
| 30 | + |
| 31 | +### Prepare Micro-ROS Agent |
| 32 | +``` |
| 33 | +ros2 run micro_ros_setup create_agent_ws.sh |
| 34 | +colcon build |
| 35 | +source install/local_setup.bash |
| 36 | +``` |
| 37 | +### Run and Connect Device |
| 38 | +Start the Micro-ROS Agent, remember to reset the microcontroller to establish connection with the agent |
| 39 | +``` |
| 40 | +ros2 run micro_ros_agent micro_ros_agent serial --dev [device] |
| 41 | +``` |
| 42 | +where `[device]` is likely `/dev/ttyUSB0` or you can try `dmesg |grep tty` |
| 43 | + |
| 44 | +You should see the following |
| 45 | +``` |
| 46 | +[1596701204.291016] info | TermiosAgentLinux.cpp | init | running... | fd: 3 |
| 47 | +[1596701205.760299] info | Root.cpp | create_client | create | client_key: 0xF005BA11, session_id: 0x81 |
| 48 | +[1596701205.760416] info | SessionManager.hpp | establish_session | session established | client_key: 0x4026907153, address: 1 |
| 49 | +``` |
| 50 | +You can also `-v6` add the end of the line for debugging |
| 51 | +### Monitor messages |
| 52 | +In a new terminal |
| 53 | +``` |
| 54 | +cd uros_ws |
| 55 | +. install/setup.bash |
| 56 | +ros2 topic list |
| 57 | +``` |
| 58 | +As per the app you are running you will get the topics related to them |
| 59 | +``` |
0 commit comments