Auto Logging from start to finish of laps

Discussion on the Lua Scripting capabilities for RaceCapture/Pro. Also see the <a href="http://autosportlabs.net/RaceCapturePro_Lua_Scripting">Lua Scripting Guide</a>

Moderators: JeffC, stieg

Post Reply
Dirty Deeds
Posts: 15
Joined: Mon Jun 20, 2016 10:31 pm
Location: Australia
Contact:

Auto Logging from start to finish of laps

Post by Dirty Deeds »

Hi Guys,
Can anyone help with the correct script, I'm trying to set up the auto logging to start recording at the beginning of a lap & finish at the end of a lap. Cheers.
Last edited by Dirty Deeds on Sat Oct 08, 2016 5:37 pm, edited 1 time in total.
Get in, Hold on , Shut up & pass me my Beer!

gizmodo
Posts: 138
Joined: Mon Aug 05, 2013 10:22 pm

Post by gizmodo »

What kind of event are you doing? Based on the requirements I'd guess you're autocrossing, is that right?

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

Post by toga94m »

There are a handful of options here - https://wiki.autosportlabs.com/RaceCapt ... g_Examples I have the battery-voltage version working on my Mk1 hardware. I'm having trouble combining it with reading/logging CANBus channels though. Mk1 has limited script memory available...

Code: Select all

function onTick&#40;&#41;
  if getAnalog&#40;7&#41; > 13 then
    startLogging&#40;&#41;
  else
    stopLogging&#40;&#41;
  end
end
I don't mind having some excess non-moving data before and after each run. I prefer that to using a GPS speed trigger, so I don't miss the beginning of the run. Some of our starts have a 90-degree bend before the timing lights, to encourage less speed/burnouts at start, to reduce damage to our parking lot.
------------
Learning Race Capture Pro... on someone else's car
Learning Python/Kivy on my own PC

rdoherty
Posts: 215
Joined: Fri Mar 08, 2013 3:32 am

Post by rdoherty »

You could combine the start/stop logging examples with the function getAtStartFinish() https://wiki.autosportlabs.com/RaceCapt ... nish.28.29

Although I am unsure if that function will return true for a separate start and finish line. You will need some extra code to handle state too.
Ryan Doherty
Autosports Labs

Dirty Deeds
Posts: 15
Joined: Mon Jun 20, 2016 10:31 pm
Location: Australia
Contact:

Post by Dirty Deeds »

Thanks guys, we're running jet sprint boats & have tried using auto log Lau with speed & rpm, but we seem to log a lot of small files when warming up etc. making it hard to determine which files are actually laps. Would something like this work? :


function onTick()
if getAtStartFinish() = start
startLogging()
else
if getAtStartFinish() = finish
end
end
Get in, Hold on , Shut up & pass me my Beer!

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

Post by brentp »

You might try that out - just ensure you have your tick rate set to 10Hz or higher, so it has a chance to catch it in the start finish point.

let us know how it goes!
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

Post Reply