... | ... | @@ -4,8 +4,8 @@ The communication between the Raspberry Pi and the Pixhawk works via the RTPS/DD |
|
|
We were able to establish the connection, using the UART interface of the RPi and the Pixhawk.
|
|
|
|
|
|
### Hardware Setup
|
|
|
The setup is shown in the figure below. The TX/RX UART ports are connected accordingly. Therfore we opened a pixhawk telemetry cable and connected it via alligator clips and jumper wires to the RPi. However, this is not a practical solution. Therfore we are aming to use a Micro USB Cable.
|
|
|
![rtps_physical_setup](uploads/8cb3a56e8363017f9dffda803b26a199/rtps_physical_setup.png)
|
|
|
To connect the pixhawk and the raspberry pi, use the enclosed cable. On the pixhawk side, it is pluggend into the TELEM1 port and on the raspberry pi side, use one of the four usb ports. \
|
|
|
Only connect the cable to the raspberry pi, when the raspberry pi is fully booted!!! When the cable is connected prior to the booting process, the raspberry pi will not be able to start. Until now, the reason for this is not known.
|
|
|
|
|
|
### Software Setup
|
|
|
#### Pixhawk
|
... | ... | @@ -23,13 +23,10 @@ When the phyiscal Interface is changed, the device '/dev/ttyS3' must be adjusted |
|
|
|
|
|
#### Raspberry Pi 4
|
|
|
The Ubuntu 20 SD Cards from Maarten are already set up. \
|
|
|
On every new startup, the access to the serial port must be granted by typing:\
|
|
|
`chmod o+rw /dev/ttyS0`\
|
|
|
The privileges can be checked using\
|
|
|
`ls -axl /dev/ttyS0`\
|
|
|
Sometimes, the system resets the priviliges... then you need to be fast to run the next command:\
|
|
|
`micrortps_agent start -t UART -d /dev/ttyS0`\
|
|
|
This starts the rtps agent program which handles the connection. To see if the setup works correctly, start the example code. Therfore, open a new terminal and source the ROS2 workspace:\
|
|
|
To start the rtps agent, run the command. \
|
|
|
`micrortps_agent start -t UART -d /dev/USB0`\
|
|
|
This is tested for a setup where only a mouse, a keyboard and the pixhawk were connected to the raspberry pi. If other devices are connected, it may be, that the device path for the pixhawk is different (e.g. /dev/USB1). \
|
|
|
The given command starts the rtps agent program which handles the connection. To see if the setup works correctly, start the example code. Therefore, open a new terminal and source the ROS2 workspace:\
|
|
|
`source ~/px4_ros_com_ros2/install/setup.sh`\
|
|
|
Then, start the supplied program:\
|
|
|
`ros2 launch px4_ros_com sensor_combined_listener.launch.py`\
|
... | ... | @@ -38,4 +35,4 @@ If it shows the realistic and timely changing measurements, the communication wo |
|
|
See [here](https://docs.px4.io/master/en/ros/ros2_comm.html#ros-2-example-applications) for more information on how to read and write data via the rtps interface.
|
|
|
|
|
|
## Next Steps
|
|
|
- [ ] Evaluate other ways for physical connection |
|
|
\ No newline at end of file |
|
|
- [x] Evaluate other ways for physical connection |
|
|
\ No newline at end of file |