hello brothers, i’m px4 newbie and im on the project which making web drone control system.
thanks to the people here, i fixed my problem and now my gazebo and QGC is running properly.
and now i want to ask how to send my mavlink message to my drone.
when i get order from website(like changing waypoint route), i have to command my drone(more than 1) to do.
as far as i know, in realworld drone and QGC communicate using mavlink. so i want to write code that work like QGC’s command(takeoff, waypoint mission etc) using mavlink.
i know basic offboard control thanks to ROS 2 Offboard Control Example | PX4 Guide (main), but what i want is maybe different thing.
So the things I’m curious about are:
-
can the drone be controlled just by sending a mavlink message like in the offboard example? If you don’t mind, I would appreciate it if you could provide a link to the example code for controlling px4 via mavlink.
-
i study offboard control by px4_ros_com/src/examples/offboard_py/offboard_control.py at 86e9aeb20e55a4673fa8a9f1c29ea06a6c5ad1af · PX4/px4_ros_com · GitHub. and I don’t understand exactly what QOS is.
qos_profile = QoSProfile(
reliability=ReliabilityPolicy.BEST_EFFORT,
durability=DurabilityPolicy.TRANSIENT_LOCAL,
history=HistoryPolicy.KEEP_LAST,
depth=1
)
Is there any problem if I just attach this qos_profile to all publishers and subscribers?
-
In the offboard example above, i run PX4_SYS_AUTOSTART=4001 PX4_GZ_MODEL_POSE=“0,0” PX4_GZ_MODEL=x500 ./build/px4_sitl_default/bin/px4 -i 1 and that offboard node didn’t work, and i restart with -i 0, and all thing good.
it is suspected that -i 0’s topic is start with /fmu/in/, and -i 1’s topic is start with /px4_1/fmu/in/.
so how can i control specific instance?
in Multi-Vehicle Simulation with ROS 2 | PX4 Guide (main), Is it possible to solve the problem by simply adding an instance number to the target_system of the message? (like -i 1 to target_system 2) -
Is there a way to create my drone at the desired coordinates and move it to the desired coordinates? I searched hard, but I could only find a manual way to change QGC’s home lat/lon. I want each drone to spawn at specific coordinates by using command like PX4_SYS_AUTOSTART=4001 PX4_GZ_MODEL_POSE=“0,0” PX4_GZ_MODEL=x500.
I would also like to find a way to move the drone using coordinates. Maybe mavlink can solve this?
Thank you for reading my current problems. I hope my problems will help newbies in the future.