How to get motor rpm in gazebo

Dear everyone.

I tried to get motor rpm(or motor velocity) in gazebo, but i can’t.

I created custom msg(to get motor rpm) in Firmware/msg directory.
After that, i include lib(#include <uORB/Subscription.hpp>) in gazebo_motor_model.h(Tool/sitl_gazebo/include)
But, it can’t compile(#include <uORB/Subscription.hpp>).

I don’t know how to solve this problem.
How can i get the motor rpm while doing sitl?

@eogks465 The msg directory in firmware is the message defnition for uORB which is a PX4 internal message and does not interact with Gazebo.

You can read up on the architecture of the simulation here: Simulation | PX4 User Guide

You can check the rpm of the motors here: PX4-SITL_gazebo/gazebo_motor_model.cpp at 7fda4d311a9daff4bec4f2fe83e63fde0b8f04b0 · PX4/PX4-SITL_gazebo · GitHub in the gazebo plugin.

If you want to use this in PX4, you need to send that over with some other form such as a HIL mavlink message.

@Jaeyoung-Lim Thank you for reply.

That is, do I need to create a custom mavlink message to use motor speed data in PX4?