Hi!
How to set GPS coordinates (lat, lon, alt, speed, etc) via MAVLink for px4? I’d like to set position for px4 without gps-reciever. Can I use for this purpose HIL_GPS message in real MAV?
Thanks!
Hi!
How to set GPS coordinates (lat, lon, alt, speed, etc) via MAVLink for px4? I’d like to set position for px4 without gps-reciever. Can I use for this purpose HIL_GPS message in real MAV?
Thanks!
You can’t use HIL_GPS.
Depending on how you are providing position source, you might use the ATT_POS_MOCAP message - see http://dev.px4.io/en/ros/external_position_estimation.html and http://dev.px4.io/en/tutorials/motion-capture-vicon-optitrack.html
Thanks, @hamishwillee .
I am also curious about this question. Can you explain why we can’t use HIL_GPS?
I noticed something interesting that in the Simulation page:
All simulators communicate with PX4 using the Simulator MAVLink API. This API defines a set of MAVLink messages that supply sensor data from the simulated world to PX4 and return motor and actuator values from the flight code that will be applied to the simulated vehicle. The image below shows the message flow.
I am curious why we can’t pass GPS coordinates through MAVLink?
PX4 uses a simulation-specific module to listen on UDP port 14560. Simulators connect to this port, then exchange information using the Simulator MAVLink API described above. PX4 on SITL and the simulator can run on either the same computer or different computers on the same network.
As we know, the QGC can set GPS, so why can’t we use the simulator to set GPS ?
Thanks for your attention.
You can’t pass those messages via mavlink because they are enabled for simulation only. The simulator handler file that deals with this message in the diagram above is called simulator_mavlink.cpp - that isn’t even built into PX4 on real hardware. In a HITL build a message handler does exist but all the PWM outputs are disabled.
As we know, the QGC can set GPS, so why can’t we use the simulator to set GPS ?
We don’t know that.
What use case are you trying to meet - ie why do you need to do this? I ask because the normal reason is for indoor flight, and if that is the case then the right way to do this is normally via the messages I pointed you to.
Hello, I am doing pretty similar think. At this moment I have a model, that uses GPS until it goes inside of a sphere where no GPS data are available because of the noise source. I am searching for the solution how to get a switchable position source, for example: at mission or offboard control to have a possibility to switch at one point from GPS to vision estimation or something similar to that idea. I know how to make it for hardware purpose (I think I know), but for presentation of SITL I would like to obtain the possibility of switching. Could you propose me a solution or the idea where to start digging? I am using PX4/MAVROS/DroneCode SDK with OFFBoard control for mission control
@arcematrix For SITL, isn’t GPS always provided even when you’re nominally flying underground? i.e. are you sure this is really a problem for presentation purposes?
hi , i want to send gps message in px4 sitl with command : HIL_GPS (113) in python with pymavlink library but when i run my program that send this command in while true loop nothing happen in px4 sitl , can you give me more information . thnaks.
@marry_tailor Please don’t necrobump old discussions.
IF you create a new issue, please explain WHY you want to send this message - you’re writing your own simulator?
hi
i created new topic about my issue but no one anwer me which is : PX4 Sitl Gps,
however i work on my master thesis and i have a real gps module which is ( Holybro M10 standard GPS)and i want to send its information to px4 sitl.i want to modify some parameters of this gps module then i want to see the results. thansk