QGroundControl sending all the information (
flight modes, altitude, velocity, joystick values etc) to MavLink as two ways communication and then, Mavros is getting this information the same way with two ways communication (publisher and subscriber), then we can use these in our own .cpp file to control our drone in Gazebo / Px4 / ROS.
What I want to do is getting these information from
QGroundControl directly via mavros and print them with ROS_INFO.
What I have done so far is this to check what I receive for joystick output:
After I open my QGroundControl and Gazebo and then I move the drone with joystick
rostopic echo /mavros/rc/out
and then I started to see the output below. However, when I press the buttons on the joystick or when I move the joystick then, no changes happen on the terminal output at all.
rostopic echo /mavros/rc/in and
rostopic echo /mavros/rc/override - there are nothing is published already. Thus, how can I read the joystick values of QGROUNDCONTROL? thank you.
channels: [1553, 1557, 1554, 1555, 1000, 1500, 1500, 1500, 0, 0, 0, 0, 0, 0, 0, 0]
channels: [1557, 1553, 1553, 1559, 1000, 1500, 1500, 1500, 0, 0, 0, 0, 0, 0, 0, 0]
Do you know why no changes happens even I move the joystick?
Once If I start reading these values which are in arrays in the terminal, but how can I pull the values I want, such as the first value or only the 2nd value too? thank you. In addition to that the values shown in the terminal are not so trustworthy because when I push forward the joysticks, sometimes the values in the terminal are not changing at all visually.
Thus, I couldn’t find why I cannot get the joystick’s button values when I press to see in the rostopic echo /mavros/rc/out
I had tried the “rosrun joy joy_node” which at least I can see the joystick changes there unlike QGroundControl /mavros/rc/out; but it is not what I want.
Apart from that, do you know which mavros topics represents that shows the flight mode changes, altitude / velocity changes occur on the QGroundControl directly? which I want to see these changes in ROS automatically to print on ROS_INFO too.