Is it possible to look up if something is published to a certain MAVLink topic? I am publishing a message via mavros to a custom MAVLink topic and try to read it with PX4. I am not sure if mavros does not publish the topic or PX4 does not read it.
I created two messages in uORB, one to send data to my custom MAVLink topic and one to receive data from it. When I try to compilate it it works just fine. But I receive nothing from the MAVLink topic. Do I have to announce it somewhere that I use a custom MAVLink topic too?
I am also having some trouble with a custom MAVLink message.
I’m trying to send a second message using TELEM2 on a PixRacer (so px4fmu-v4). As practice I just decided to use the ca_trajectory help there.
I can compile and upload just fine using
make px4fmu_default upload
What I’ve been trying to figure out for days is that I added the following to my rcS file:
if param compare SYS_COMPANION 1499
then
mavlink start -d ${MAVLINK_COMPANION_DEVICE} -b 57600 -s CA_TRAJECTORY
fi
What do all of these options mean? I’m guessing -d is device, -b is baudrate, what is -s? I can’t seem to find where the code that parses that command is.
I realized after writing this that the SYS_COMPANION code was under an
if ver hwcmp PX4FMU_V1
statement. Probably a part of why my Arduino is seeing nothing when connected to the TELEM2 port. Nonetheless I’m curious what all of the options are for starting mavlink. Is there a problem with having two “mavlink start” in the rcS code?
I tried it within PX4. I added two different topics (gazebo_pos.msg and gazebo_pos_test.msg). In an example app I publish data to the gazebo_pos_test topic
In addition I added in mavlink_receiver.cpp the follwoing function in order to receive the data from the MAVLink topic and put it into the gazebo_pos uORB topic
In my example app I subscribe to this uORB topic (gazebo_pos). But when I print the receiving data I dont get the right values for for x,y,z (1.0,2.0,3.0). Instead I get for y = 0 and fpr x and z really high numbers such as 5468798798.
Do you know what I am doing wrong?
I’m trying to do the same. I am able to read all messages coming from the px4 -> mavlink -> mavros -> ros. But i am not able to send my custom message to px4. Almost the same problem like you, but with the only difference, that I don’t need a separate uORB msg. I tried to send some set_actuator_control messages to px4 ( from ros->mavros->mavlink->px4) and they worked fine for me, after offboard configuration was done. The code for my message is almost the same.
Have you sovlved your problem? We are able to read messages comming from ros -> mavros ->mavlink ->px4, but not for the inverse way. Could you please list all steps that you have done for reading messages coming from the px4 -> mavlink -> mavros -> ros.