get device give me some data as
22.11.2023 12:13:11 : driver2ScriptingCANBuffer: 0x24036170
22.11.2023 12:13:11 : driver1ScriptingCANBuffer: 0x24036148
but frames itself is nil.
I did try set local driver1 = CAN:get_device(1) and 5 and 10 and 12 and trying change CAN_D2_PROTOCOL to 1/5/10/12. Still nothing.
GPS itself working great, but i can’t get data from it via LUA.
Any suggestion? There is no much info about CAN + Lua, makes me think example code should work from box. Did i miss something?
If you’re using the GPS for navigation, you won’t be accessing it directly on the CAN bus with Lua. To access a CAN device via scripting, you need to use the scripting back end (CAN_Dx_PROTOCOL=10), which will render that device inaccessible to the autopilot as a nav device (unless there is a workaround of which I’m unaware).
I am doing indoor navigation, but part of the path we take is outdoors. I want to automatically turn GPS on and off depending on the accuracy (conditionally, the number of satellites). Since GPS involves waves, reflections off buildings can significantly affect navigation.
My plan was this - if I see that there are less than 10 satellites, I set GPS type to 0 and no longer use it for AHRS and navigation. When I receive data through a Lua script via the CAN bus that there are more than 20 satellites, I set GPS type to 9 and turn on the GPS data in AHRS.
Issue comes that if set gps type 0, i don’t know current amount of sats.
Yes, but our system working as GPS(mavlink).
So surely best solution would be just “amount” of sats that system see (like AHRS_GPS_MINSATS), but i not sure if it work the way i wanna.
In current test gpstype 0 working great, but its not auto solution
Yes, surely I checked link .
Solution " from External Nav" is not our case, as i say, we use GPS_input via Mavlink. Or i not understand somethings? In my idea " from External Nav" mean we got some sensors, but we don’t.
I cannot change “from GPS” as source, since we are use GPS_input, mavlink one.
Link that you send is for usage sensors(Intel camera), with VISION_POSITION_ESTIMATE.
I set ahrs min sat to 10, but gps start used when there was 4 sat, so no luck with that setup.
Yes, you correct, but position estimatw will not work great on open space (in city) since long distance.
So lets be straight - flying inside buildings is issue since gps send trash to us and some randome 5m spike could lead to crash.
Turn gps off when there is no sats is great, but i need to know when its good.
I understand the basic issue. What I don’t understand is your external system for position estimate via Mavlink and why it’s also coded as a GPS source.
Why would you be trying to travel long distances within building clutter in an urban environment in the first place? This type of operation is highly illegal in most locations.