Motion attribute and GPS line traces on map

maximumcoolbeans13 days ago

I asked a related question in another thread but that thread got cluttered, so I'm trying again here but with a more specific question. I have a bike lane sweeper machine where we want the gps line traces in the map to only show up for when the brush is turned on. It seems like we need device motion events to make this work. We're getting a "device moving" event but no "device stopped" events. We're sending the following code (with the OsmAnd protocol) when the brush gets turned off. We're seeing "Ignition off" as an event in the server, but we're not seeing any events about motion being off (which I'm assuming would be the "device stopped" event type; please correct me if this is wrong).

String gprsEnvelop = "/?id=" + sweeperId + "&ignition=false&motion=false";

On the server side, minimalTripDuration is set to 1 second, minimalTripDistance is set to 1 meter, minimalParkingDuration is set to 999999 seconds, and the rest are defaults for the motion.

I'm assuming that by directly reporting the motion attribute, that we'll have control over when the gps line traces start and stop. As mentioned here (https://www.traccar.org/trips-stops/): "The standardized motion attribute was introduced to have a universal way of handling device motion for all protocols. Some devices report this attribute directly."

Anton Tananaev13 days ago

Motion is not a single event. Even if you set duration to 1 second, you need at least two values with 1 second time difference.

maximumcoolbeans13 days ago

Here's an example of the events from a recent test that I made with the bike lane sweeper. You can see that there are multiple events. But there's no "device stopped" event (if that's the correct type of event to end lines on the map).
2024-12-10 17_51_04-.jpg

Anton Tananaev13 days ago

What I meant is that you have to continuously send motion as false, not just once.

hairydog12 days ago

In my experience, GPS fixes are not accurate enough to give positions less than a metre apart.
If you are requiring movement of less than a metre to define 'no motion', you are never going to get it. The position jitter will always be more than a metre between consecutive fixes.

maximumcoolbeans12 days ago

@Anton Tananaev Thanks for clarifying that!

@hairydog The purpose of the threshold setting values that I mentioned is to prevent the algorithm from interfering with when motion is on and off. In other words, it's to disable the logic that determines motion. What we want is to directly set when the motion is on and off by reporting the motion attribute directly.