Hello,
I’m new to PX4 and just kind of got thrown into an old project that nobody really knows the details of anymore…
That project was about controlling a Horus Octocopter Drone via offboard flight commands to keep a certain offset to another PX4 unit. The idea is to fly the drone manuallly into position, then flip a switch on the Remote and have the drone stay in its relative position to another PX4 module which is then mounted on a vehicle. Before testing this on the real Drone, it was of course simulated. For simulation purposes the second PX4 unit won’t be needed, because the position from which the offset is kept is just a variable in the code.
Unfortunately there is not a lot of documentation on how the simulation was set up exactly. So as far as I got now, I have an ubuntu system running similiar to the one on the actual drone. On this system there is an instance of jmavSim running, simulating the physical Drone with its PX4 control unit, then there is an instance of QGroundControl running, communicating with it and showing its location on the map. I don’t know if on the real drone you would run QGroundControl on the same OS and not aon a seperate Computer on the ground, but for simulation purposes it doesn’t really matter. I can start flying using QGroundControl and bring the drone into position. Now I can run the project’s code which also establishes a connection with jMavSim. The code is then waiting for the command to start it’s offset keeping procedure. And that’s where I get stuck because I have no idea how to do this in the simulation.
With the actual drone and the Remote Control (FrSky X10S), I just flip one of the levers.
In the actual code it’s a simple if statement:
if (mavChannels.chan6_raw > channelMin + 0.67 * (channelMax - channelMin) && !scoutingOn) {
with
mavlink_rc_channels_t mavChannels;
uint16_t channelMin = 982;
uint16_t channelMax = 2006;
My question would be: How do I send data on “channel 6” using this simulation setup? My guess would be that somehow QGroundControl provides some functionality for that but I couldn’t find it.
Sorry for the long post, also sorry if this is a stupid question… I hope it’s answerable.