Issues with Lap Timer?

Discussion on the RaceCapture App - Windows, Android, OSX and Linux.

Moderators: JeffC, stieg

momostallion
Posts: 58
Joined: Wed Feb 12, 2014 1:48 pm
Location: dallas, tx

Issues with Lap Timer?

Post by momostallion »

Hey guys, just wondering if the lap timer feature (as well as the streaming telemetry to race-capture.com feature) isn't active on V2 beta or if I am doing something wrong. I'm going to be hitting the track soon so I want to make sure this setup will work. I just tested by setting up a custom start/finish line and I had nothing but issues. Either i get no laps or it just increments the lap counter every 10.x seconds.

Here is my current setup:
RCP MK1 Firmware v2.7.6 + bluetooth module + CanX module
RaceCapture Windows app v1.2.2
RaceCapture Android app (beta v1.2.3)


I can provide more details and sdcard .log file and .rcp config but if this isn't a feature that has ported to V2 beta, then I have my answer.

brentp
Site Admin
Posts: 6274
Joined: Wed Jan 24, 2007 6:36 am

Post by brentp »

Hi- that is definitely an incorrect behavior.

Can you post your RCP configuration file and we can take a look? You're on the currently latest 2.7.6 firmware, correct?
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

momostallion
Posts: 58
Joined: Wed Feb 12, 2014 1:48 pm
Location: dallas, tx

Post by momostallion »

Thanks for the quick reply Brent.

Yes, unit is mk1 on firmware 2.7.6.

Attached is a zip containing my .rcp config file along with .log file. The log file should show I drove the same roads across my starting line 3-4 times as test track. But in the log file you should see the lap count incrementing begining at interval 117015.

EDIT: zip was slightly to large to attach, i put it on google drive:
https://drive.google.com/file/d/0B32khi ... sp=sharing

Here is a screen shot of the race track/sectors page:
Image


One thing I noticed is when I enter in latitude 33.077303 and longitude -96.668958 and upload the config to the unit, I can retrieve the settings from the MK1 and it has changed the numbers ever so slightly to 33.077305 and -96.668961. Potentially a byproduct of data type conversion? Shouldn't be a big deal but I figure I should note the behavior.

momostallion
Posts: 58
Joined: Wed Feb 12, 2014 1:48 pm
Location: dallas, tx

Post by momostallion »

Also, I'm not sure what the default radius is for starting points or if there are any special conditions to trigger lap start.

I consulted the RaceCapturePro V2 User's Guide read this note:
The beginning of a lap is triggered by the combination of a start point which defines the general area where the race car is staged, and a launch detection algorithm combining a speed and g-force delta threshold.
This is listed under Separate Start/Finish Lines so I wouldn't think this applies but either way it doesn't explain the lap count incrementing every ~10.x seconds.

stieg
Posts: 100
Joined: Fri Dec 20, 2013 1:37 am
Location: Madison, WI
Contact:

Can you use a pre-defined track

Post by stieg »

I have seen this behavior before but am still hunting down the root cause. One question: Do you see this issue when you use a predefined track as opposed to specifying your own start/finish points? Its an outside shot but any info you have will be useful in tracking down this issue.
Andrew Stiegmann (Stieg)
Principal Engineer
Autosport Labs Inc.

stieg
Posts: 100
Joined: Fri Dec 20, 2013 1:37 am
Location: Madison, WI
Contact:

Default radius

Post by stieg »

Also FYI the default radius is about 11M. Hope that helps.
Andrew Stiegmann (Stieg)
Principal Engineer
Autosport Labs Inc.

momostallion
Posts: 58
Joined: Wed Feb 12, 2014 1:48 pm
Location: dallas, tx

Post by momostallion »

Hi Andrew, thanks for the response.

I have only used the device prior to V2/beta firmware on track so I haven't been able to test predefined tracks.

On firmware 1.2.8 i can verify that the device does trigger starting/finish beacon with those specific coordinates.

toga94m
Posts: 127
Joined: Wed Jun 05, 2013 1:57 am
Location: Upstate NY

Post by toga94m »

Confirming.. thought it was just me. Here's my RCP config, and a logfile massaged into OpenOffice Calc. Hardware is Mk1, firmware 2.7.6, GPS/bluetooth but no telemetry. When lapcount started ticking upward, I was a few miles from my start/finish line. Seems to be incrementing at a steady rate (I plotted lapcount vs time) independent of speed or position.

When I was running the original firmware, I created a test track around the block near home, loaded the JSON in, and had RCP counting laps for me, even showing up on the Android app via bluetooth. I used the same coordinates a few weeks ago with no triggers.

Tonight I used the Windows app to reconfig, and moved to a different start/finish (43.08, -73.7711), but lapcounting is still being weird. Near the end of the logfile I crossed this point several times, no effect on the continual increase of lapcount.

I also notice that the Distance field is weird - mostly zero, but jumps to a few constants : 3735928559 1083683.75 and -6044.697 ... usually for a while, but sometimes just for one log record. This happens in the logfile before the lapcounter upticking starts, so I'm not suspecting any relation between the two.
Attachments
RC_27-parts.zip
rcp config and logfile spreadsheet
(206.95 KiB) Downloaded 88 times
------------
Learning Race Capture Pro... on someone else's car
Learning Python/Kivy on my own PC

toga94m
Posts: 127
Joined: Wed Jun 05, 2013 1:57 am
Location: Upstate NY

Post by toga94m »

More clues.. From lap 55-75, lapcount ticks up at a nearly-constant 10.15-ish second rate. Laptime shows at 0.1683 minutes/lap which agrees (=10.1/60) Sector time is 0.0017 minutes. (All sector coordinates are set to 0,0) Speed during these "laps" ranges randomly from 0-30mph. My datalogging rates are 1/sec, 5/sec, or 10/sec depending on variable.
------------
Learning Race Capture Pro... on someone else's car
Learning Python/Kivy on my own PC

toga94m
Posts: 127
Joined: Wed Jun 05, 2013 1:57 am
Location: Upstate NY

Post by toga94m »

Steig - does MK1 hardware/processor correctly run distPythag() and fast_square_root() as found in geopoint.c? Or is that too much maths for it?
------------
Learning Race Capture Pro... on someone else's car
Learning Python/Kivy on my own PC

brentp
Site Admin
Posts: 6274
Joined: Wed Jan 24, 2007 6:36 am

Post by brentp »

toga94m,

I can answer that, and yes. In fact, the previous MK1 firmware ran a much less efficient algorithm before fast_square_root() was added- and back then, it ran without problems at 10Hz. The MK1 processor is plenty fast, even with the old algorithm, and fast_square_root() only gave it even more processing headroom. Hence the word fast. ;)

The problem is likely a more mundane logic error on our part.
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

toga94m
Posts: 127
Joined: Wed Jun 05, 2013 1:57 am
Location: Upstate NY

Post by toga94m »

Tonight I created a test-track map JSON and had the Windows app load it to the RCP. One start/finish, four corner datapoints, no sectors defined. I also set config for auto-track-detect instead of hardcoding the start/finish coordinates like previous tests. Helpful tip for others - the track JSON files are living at C:\Users\Tom\AppData\Roaming\racecapture\venues on my Win8 machine. Took a half-hour to find them again, I knew where they were last summer............

I drove around the block a few times with bluetooth streaming to my Android tablet, crossed start/finish three times, but never saw the lapcounter do the right thing. Eventually it started doing the increment-every-10-seconds trick.

Once I got the log into a spreadsheet, I found a new clue. The Sector number is logged at -1 until the first time I cross start/finish. Then it bumps one to 0, and stays there.. and that's when the lap counter starts incrementing at the 10-second rate. I'm now convinced the start/finish detection and auto-track detection is working, because the sector change happened at -73.771217 by 43.080647 and my start/finish is tagged at -73.7711 by 43.0800

Does lap counting work on other test tracks with no sectors defined, like Oregon Test Track 1?
Attachments
RC_28 - Copy.zip
logfile driving around my test racetrack, 3 times over start/finish point
(211.36 KiB) Downloaded 102 times
------------
Learning Race Capture Pro... on someone else's car
Learning Python/Kivy on my own PC

toga94m
Posts: 127
Joined: Wed Jun 05, 2013 1:57 am
Location: Upstate NY

Post by toga94m »

I found an explanation for the 10 second delay for lap upcounting...
#define START_FINISH_TIME_THRESHOLD 10000

A little above that, something looks odd to my n00b self. There's a definition for
static int processStartFinish(const Track *track, const float targetRadius) {

and a const variable, then some code.... then we define some more variables without any function definition above it. I'm guessing that's legal or it wouldn't compile.. but aren't all the variables supposed to come first?
------------
Learning Race Capture Pro... on someone else's car
Learning Python/Kivy on my own PC

stieg
Posts: 100
Joined: Fri Dec 20, 2013 1:37 am
Location: Madison, WI
Contact:

Nice work thus far

Post by stieg »

Nice work toga94m. I intend to dig into this more tonight. I'll add what I find here.
The Sector number is logged at -1 until the first time I cross start/finish.
Yep. That is expected. That is how I know when you have actually crossed start/finished and triggered a launch event.
Does lap counting work on other test tracks with no sectors defined, like Oregon Test Track 1?
It should. But I can test this further tonight. By test track I assume you are referring to one you created by hand?
found an explanation for the 10 second delay for lap upcounting...
#define START_FINISH_TIME_THRESHOLD 10000
That is a big find. Its 10.1 because we sample every 1/10th of a second, so that makes perfect sense to the cadence. This would imply that if I were to adjust this value to say 20 seconds, it would take 20.1 seconds before it ticks up. That would indicate that the algorithm always thinks it in the start/finish GeoCircle. Interesting. More to come tonight.
Andrew Stiegmann (Stieg)
Principal Engineer
Autosport Labs Inc.

toga94m
Posts: 127
Joined: Wed Jun 05, 2013 1:57 am
Location: Upstate NY

Post by toga94m »

I filtered all available tracks by the word 'TEST' and found that one in Oregon, assuming it was one used by RCP authors for drive-testing. I was curious if existing drive-testing had been done on track definitions that had sectors in them, or if they were simple one-stage tracks like my rectangle.

I'm also wondering why Distance in the logfile jumps around all over the place - if that's related. If that's the odometer per lap, then it shouldn't be non-zero when we haven't crossed start/finish yet.. but it kicks out those huge numbers like 3735928559 occasionally (for the first 90+ seconds of my logfile), then returns to 0... Then midway through 10-second lap #2, it gives me -0.015 and -45136.617, then returns to zero for lap #3.

From /src/logger/loggerSampleData.c
chanCfg = &(gpsConfig->latitude);
sample = processChannelSampleWithFloatGetterNoarg(sample, chanCfg, getLatitude);
chanCfg = &(gpsConfig->longitude);
sample = processChannelSampleWithFloatGetterNoarg(sample, chanCfg, getLongitude);
chanCfg = &(gpsConfig->speed);
sample = processChannelSampleWithFloatGetterNoarg(sample, chanCfg, getGpsSpeedInMph);
chanCfg = &(gpsConfig->distance);
sample = processChannelSampleWithFloatGetterNoarg(sample, chanCfg, getGpsDistanceMiles);
chanCfg = &(gpsConfig->satellites);
sample = processChannelSampleWithIntGetterNoarg(sample, chanCfg, getSatellitesUsedForPosition);
------------
Learning Race Capture Pro... on someone else's car
Learning Python/Kivy on my own PC

Post Reply