ROS 2 package for receiving CRSF (RC channels values) packets over serial port (UART).
rc/channels
- received rc channels valuesrc/link
- connection statistics information
Install CppLinuxSerial
before:
git clone https://github.com/gbmhunter/CppLinuxSerial.git
cd CppLinuxSerial
mkdir build/
cd build
cmake ..
make
sudo make install
cd ../..
Let's assume that your ros 2 workspace localized at ~/row2_ws/
.
cd ~/row2_ws/src
# Types dependency package:
git clone https://github.com/AndreyTulyakov/ros2_crsf_receiver.git
cd ~/row2_ws
colcon build --packages-select crsf_receiver_msg
colcon build --packages-select crsf_receiver
source ~/row2_ws/install/setup.bash
- Serial device name:
device
, default is/dev/ttyUSB0
- Baud rate:
baud_rate
, default is420000
- Enable / Disable link statistics info:
link_stats
, default isfalse
- Receiver rate (hz):
receiver_rate
, default is100
# Run Node with default parameters
ros2 run crsf_receiver crsf_receiver_node
# Or setup and run Node with custom parameters values:
ros2 run crsf_receiver crsf_receiver_node --ros-args -p "device:=/dev/serial0" -p baud_rate:=420000 -p link_stats:=true
After correct setup and running without errors you can check topics:
# Check channels values
ros2 topic echo /rc/channels
# Check link statisics
ros2 topic echo /rc/link
# Check receiver rate
ros2 topic hz /rc/channels
uplink_rssi_ant1
- ( dBm * -1 )uplink_rssi_ant2
- ( dBm * -1 )uplink_status
- Package success rate / Link quality ( % )uplink_snr
- ( db )active_antenna
- Diversity active antenna ( enum ant. 1 = 0, ant. 2 )rf_mode
- ( enum 4fps = 0 , 50fps, 150hz)uplink_tx_power
- ( enum 0mW = 0, 10mW, 25 mW, 100 mW, 500 mW, 1000 mW, 2000mW )downlink_rssi
- ( dBm * -1 )downlink_status
- Downlink package success rate / Link quality ( % )downlink_snr
- ( db )