How to read messages on the CAN bus?

I got ESCs that publish the motor RPM to the CAN bus which would allow me to adjust the PWM/CAN signal to reach the desired RPM more accurately.

How can I read these messages with the pixhawk(4) ? I’ve been using uavcan to publish messages but it doesn’t seem like it is as easy as that to subscribe to incoming messages. But it must already be done somewhere as I know that PX4/UAVCAN supports sensors on the CAN.