Motion attribute and GPS line traces on map

maximumcoolbeans2 months 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 Tananaev2 months 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.

maximumcoolbeans2 months 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 Tananaev2 months ago

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

hairydog2 months 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.

maximumcoolbeans2 months 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.

maximumcoolbeans12 days ago

Like I mentioned in the original post here, I have a bike lane sweeper machine with a brush motor that can be turned on and off, and we want the gps line traces in the reports map to only show up for when the brush is turned on. Following Anton's suggestion from a couple of messages ago, I changed the client's code so that it constantly reports motion as false when the brush is off, and now we get "device stopped" events which is good. However, my hope was that there would be no line on the reports map when the motion attribute is false, but this doesn't seem to be the case. In the following screenshot, you can see that there are a couple of "device stopped" events, one of which is at 13:59:01, and the blue line continues on the map after that.

2025-01-18 16_22_44-.jpg

The brush was off for the curved section of the blue line on the left. The point at 13:59:39 in the replay screenshot below is to show that the tracking of this section of the line was after the "device stopped" event at 13:59:01.

2025-01-18 16_23_18-.jpg

Am I doing something wrong? Is there any way to make the line not show up on the reports map when the brush is turned off, perhaps with a different attribute than motion?

Anton Tananaev12 days ago

I don't see the trips report on your screenshots.

maximumcoolbeans12 days ago

The trips report doesn't show a map which is why I showed the combined report. Here's the trips report if this helps:

2025-01-18 17_04_34-.jpg

Anton Tananaev12 days ago

You have to tap on the GPS icon to show the map.

maximumcoolbeans12 days ago

Ah ok, thanks. I wasn't aware. Is it possible to show multiple trips at the same time on the map?

Anton Tananaev12 days ago

Not possible currently.

maximumcoolbeans12 days ago

Ok. I would very much appreciate if that functionality was added. Should I make a feature request in Github?

Anton Tananaev12 days ago

Yes. Check if there's already same or similar ticket.