Cyphal communicator converts Cyphal messages to ROS and vice versa.
It covers a minimal set of sensors required for such applications as Ardupilot/PX4 Cyphal HITL simulation. This communicator can be used for other purposes as well.
The tables below represent the supported conversions:
CYPHAL->ROS
โ | ROS msg | ROS topic | Cyphal msg | Cyphal subject name |
---|---|---|---|---|
1 | sensor_msgs/Joy | /uav/actuators_raw | reg.udral.service.actuator.common.sp.Scalar_0_1 | setpoint |
2 | std_msgs::Bool | /uav/arm | reg.udral.service.common.Readiness_0_1 | readiness |
ROS->CYPHAL
โ | ROS msg | ROS topic | Cyphal msg | Cyphal subject name |
---|---|---|---|---|
1 | sensor_msgs/Imu | /uav/imu | uavcan.si.sample.angular_velocity.Vector3.1.0 | gyro |
uavcan.si.sample.acceleration.Vector3.1.0 | accel | |||
2 | sensor_msgs/MagneticField | /uav/mag | uavcan.si.sample.magnetic_field_strength.Vector3.1.0 | mag |
3 | std_msgs/Float32 | /uav/static_temperature | uavcan.si.sample.temperature.Scalar.1.0 | baro_temperature |
std_msgs/Float32 | /uav/static_pressure | uavcan.si.sample.pressure.Scalar.1.0 | baro_pressure | |
4 | std_msgs/Float32 | /uav/yaw | uavcan.si.sample.angle.Scalar.1.0 | gps_yaw |
sensor_msgs/NavSatFix | /uav/gps_position | reg.udral.physics.kinematics.geodetic.PointStateVarTs.0.1 | gps_point | |
geometry_msgs/Twist | /uav/velocity |
Gps yaw is not implemented yet because the yaw angle might be estimated from velocity.
Satellites number and other fields are not implemented yet as well.
Before running the communicator, you need to do 3 things:
- Compile DSDL. You can use compile_dsdl.sh as an example. You should compile it each time after updating DSDL.
- Create virtual CAN. It is expected that you are using CAN-sniffer device such as UAVCAN sniffer and programmer. An example of script that creates SLCAN is scripts/create_slcan_from_serial.sh. This script automatically detect a connected device and create
slcan0
port. You should create virtual CAN once after each sniffer connection to your PC. - Configure environment variables. This step is required for setting subjects port id and few pathes. As an example, you can run
source scripts/config.sh
. You should call this script in each shell session.
After these steps you are able to run the communicator.
It is recommended to run the communicator using launch file as shown below:
roslaunch cyphal_communicator cyphal_communicator.launch
Below you can see an example of using the cyphal_communicator in conjunction with a VTOL dynamics simulator.