Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#687 closed defect/bug (invalid)

Positioning improvement for routes with long road segments (patch)

Reported by: tegzed Owned by: KaZeR
Priority: major Milestone:
Component: core Version: git master
Severity: Keywords:
Cc:

Description

Hello,

I have created a patch to improve navit's positioning when there are long road segments along the route. The patch projects the actual gps position to the nearest road segment perpendicularly on the road instead of placing it to the endpoints of the segment making the movement of the map smoother. To enable this one need to add attribute position_projection="1" to the navit tag in navit.xml. Tracking also needs to be enabled for this to work. An example config is shown below:

<navit zoom="256" tracking="1" orientation="-1" pitch="0" autozoom_active="0" position_projection="1" >

Please test it if it works correctly for you and if the core team agrees also I'll commit it.

Regards, David Tegze

Attachments (2)

navit_position_projection.diff (5.8 KB) - added by tegzed 9 years ago.
fixed road segment selection
tracking_debug_err.patch (712 bytes) - added by tegzed 9 years ago.
fix for map placement error when debugging is enabled

Download all attachments as: .zip

Change History (4)

Changed 9 years ago by tegzed

fixed road segment selection

comment:1 Changed 9 years ago by tegzed

  • Resolution set to invalid
  • Status changed from new to closed

Our irc discussion with Cp15 revealed that the non smooth map update was caused by the increased debug levels in navit.xml. Setting them to 0 solved the problem and superseded this patch.

Thanks Cp15 for your help!

comment:2 Changed 9 years ago by tegzed

Hello,

My further invertigation revealed the real cause of the problem. It is related to this line in tracking_update function:

                                dbg(1,"lpnt.x=0x%x,lpnt.y=0x%x pos=%d %d+%d+%d+%d=%d\n", lpnt.x, lpnt.y, i,
                                        transform_distance_line_sq(&sd->c[i], &sd->c[i+1], &cin, &lpnt_tmp),
                                        tracking_angle_delta(tr, tr->curr_angle, t->angle[i], 0)*angle_factor,
                                        tracking_is_connected(tr->last, &sd->c[i]) ? connected_pref : 0,
                                        lpnt.x == tr->last_out.x && lpnt.y == tr->last_out.y ? nostop_pref : 0,
                                        value
                                );

in transform_distance_line_sq call in the debug statement the variable lpnt which should hold the value from tracking_value gets overwritten placing the point on osm nodes only. If I pass a temporary coord data as output parameter to this call the problem disappears.

Regards, David Tegze

Changed 9 years ago by tegzed

fix for map placement error when debugging is enabled

Note: See TracTickets for help on using tickets.