Hello,
I’m trying to extract the following data, Timestamp, attitude, altitude, lat/longitude. However, I’ve been struggling the extract the data in the same format that is shown in the “Review a Log” feature in Arudpilot.
Ideally, I’d like to extract this table straight to Excel to do some analysis. But, I’m not able to copy this table nor download it.
I tried the MATLAB convertor however it doesn’t extract the timestamp which I also need.
Does anyone have any suggestions?
Thanks in advance.
copilot
(JaSw)
July 12, 2024, 11:13am
2
Isn’t the 2nd column a time stamp?
Have you tried the “Convert .bin to .log” button. The .log file generated is also a comma separated file
Oli1
(Oli)
July 12, 2024, 11:16am
3
Either this, or you should be able to CTRL-A select everything in the log browser, CTRL-C, and paste it into Excel.
If you look somewhere in my post history, I’ve shared a Powershell script that extracts all values from a .log file and puts them in separate CSVs.
EDIT: There it is.
Add-Type -AssemblyName System.Windows.Forms
$FileBrowser = New-Object System.Windows.Forms.OpenFileDialog -Property @{
InitialDirectory = [Environment]::GetFolderPath('UserProfile')
Filter = 'Log Files|*.log|Text Files|*.txt|All Files|*.*'
Title = "Select Ardupilot Logfile to Split"
}
$null = $FileBrowser.ShowDialog()
$FolderBrowser = New-Object System.Windows.Forms.FolderBrowserDialog -Property @{
Description = "Select Output Folder (Warning: There will be many CSV files)"
}
$null = $FolderBrowser.ShowDialog()
$LogPath = $FileBrowser.FileName
$OutPath = $FolderBrowser.SelectedPath
Write-Host "That's going to take a long, long while....."
$FMTLinesReg = (Get-Content $LogPath | Select-String '(FMT,.*)') | Select-Object -Skip 1
ForEach ($item in $FMTLinesReg) {
[array]$contentary = $null
$LoopLine = $item.ToString()
$LoopModuleAry = $LoopLine | Select-String -Pattern '(FMT, [0-9]+, [0-9]+, )([\w]+), ([\w]+), (.*)'
$LoopModuleStr = $LoopModuleAry.Matches.Groups[2].Value
$LoopLineHeader = $LoopModuleAry.Matches.Groups[4].Value
$LoopFilePath = ($OutPath + "\" + $LoopModuleStr + ".csv")
New-Item -Path $LoopFilePath -Type file
Add-Content -Path $LoopFilePath -Value $LoopLineHeader
$LoopLinesReg = Get-Content $LogPath | Select-String -Pattern "^($($LoopModuleStr), )(.*)$"
ForEach ($item1 in $LoopLinesReg) {
$itemtrk = $item1 | Select-String -Pattern "^($($LoopModuleStr), )(.*)$"
$itemtrk = $itemtrk.Matches.Groups[2].Value -replace '\s+', ''
[array]$contentary += $itemtrk
}
Add-Content -Path $LoopFilePath -Value ($contentary -join "`n")
}