Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
sshane committed Nov 1, 2024
1 parent f62763b commit 1854f70
Showing 1 changed file with 9 additions and 23 deletions.
32 changes: 9 additions & 23 deletions tools/plotjuggler/layouts/longitudinal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<tabbed_widget name="Main Window" parent="main_window">
<Tab tab_name="tab1" containers="1">
<Container>
<DockSplitter count="4" sizes="0.250726;0.24879;0.251694;0.24879" orientation="-">
<DockSplitter orientation="-" sizes="0.250401;0.249599;0.250401;0.249599" count="4">
<DockArea name="...">
<plot flip_y="false" style="Lines" mode="TimeSeries" flip_x="false">
<range left="20.929753" bottom="-3.596659" top="0.462999" right="38.879028"/>
<plot flip_y="false" flip_x="false" mode="TimeSeries" style="Lines">
<range right="126.285782" top="1.391623" left="104.907277" bottom="-2.563614"/>
<limitY/>
<curve name="/carState/aEgo" color="#f14cc1"/>
<curve name="/longitudinalPlan/accels/0" color="#9467bd"/>
Expand All @@ -15,25 +15,25 @@
</plot>
</DockArea>
<DockArea name="...">
<plot flip_y="false" style="Lines" mode="TimeSeries" flip_x="false">
<range left="20.929753" bottom="-3.235835" top="0.215767" right="38.879028"/>
<plot flip_y="false" flip_x="false" mode="TimeSeries" style="Lines">
<range right="126.285782" top="1.184960" left="104.907277" bottom="-1.811222" />
<limitY/>
<curve name="/controlsState/upAccelCmd" color="#1f77b4"/>
<curve name="/controlsState/uiAccelCmd" color="#d62728"/>
<curve name="/controlsState/ufAccelCmd" color="#1ac938"/>
</plot>
</DockArea>
<DockArea name="...">
<plot flip_y="false" style="Lines" mode="TimeSeries" flip_x="false">
<range left="20.929753" bottom="-0.341797" top="13.490832" right="38.879028"/>
<plot flip_y="false" flip_x="false" mode="TimeSeries" style="Lines">
<range right="126.285782" top="15.862889" left="104.907277" bottom="-0.568809" />
<limitY/>
<curve name="/carState/vEgo" color="#1ac938"/>
<curve name="/longitudinalPlan/speeds/0" color="#ff7f0e"/>
</plot>
</DockArea>
<DockArea name="...">
<plot flip_y="false" style="Lines" mode="TimeSeries" flip_x="false">
<range left="20.929753" bottom="0.233449" top="0.562950" right="38.879028"/>
<plot flip_y="false" flip_x="false" mode="TimeSeries" style="Lines">
<range right="126.285782" top="1.025000" left="104.907277" bottom="-0.025000" />
<limitY/>
<curve name="/carControl/longActive" color="#1f77b4"/>
<curve name="/carState/gasPressed" color="#d62728"/>
Expand All @@ -48,22 +48,8 @@
<!-- - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - -->
<Plugins>
<plugin ID="DataLoad CSV">
<default delimiter="0" time_axis=""/>
</plugin>
<plugin ID="DataLoad Rlog"/>
<plugin ID="DataLoad ULog"/>
<plugin ID="Cereal Subscriber"/>
<plugin ID="UDP Server"/>
<plugin ID="WebSocket Server"/>
<plugin ID="ZMQ Subscriber"/>
<plugin ID="Fast Fourier Transform"/>
<plugin ID="Quaternion to RPY"/>
<plugin ID="Reactive Script Editor">
<library code="--[[ Helper function to create a series from arrays&#xa;&#xa; new_series: a series previously created with ScatterXY.new(name)&#xa; prefix: prefix of the timeseries, before the index of the array&#xa; suffix_X: suffix to complete the name of the series containing the X value. If [nil], use the index of the array.&#xa; suffix_Y: suffix to complete the name of the series containing the Y value&#xa; timestamp: usually the tracker_time variable&#xa; &#xa; Example:&#xa; &#xa; Assuming we have multiple series in the form:&#xa; &#xa; /trajectory/node.{X}/position/x&#xa; /trajectory/node.{X}/position/y&#xa; &#xa; where {N} is the index of the array (integer). We can create a reactive series from the array with:&#xa; &#xa; new_series = ScatterXY.new(&quot;my_trajectory&quot;) &#xa; CreateSeriesFromArray( new_series, &quot;/trajectory/node&quot;, &quot;position/x&quot;, &quot;position/y&quot;, tracker_time );&#xa;--]]&#xa;&#xa;function CreateSeriesFromArray( new_series, prefix, suffix_X, suffix_Y, timestamp )&#xa; &#xa; --- clear previous values&#xa; new_series:clear()&#xa; &#xa; --- Append points to new_series&#xa; index = 0&#xa; while(true) do&#xa;&#xa; x = index;&#xa; -- if not nil, get the X coordinate from a series&#xa; if suffix_X ~= nil then &#xa; series_x = TimeseriesView.find( string.format( &quot;%s.%d/%s&quot;, prefix, index, suffix_X) )&#xa; if series_x == nil then break end&#xa; x = series_x:atTime(timestamp)&#x9; &#xa; end&#xa; &#xa; series_y = TimeseriesView.find( string.format( &quot;%s.%d/%s&quot;, prefix, index, suffix_Y) )&#xa; if series_y == nil then break end &#xa; y = series_y:atTime(timestamp)&#xa; &#xa; new_series:push_back(x,y)&#xa; index = index+1&#xa; end&#xa;end&#xa;&#xa;--[[ Similar to the built-in function GetSeriesNames(), but select only the names with a give prefix. --]]&#xa;&#xa;function GetSeriesNamesByPrefix(prefix)&#xa; -- GetSeriesNames(9 is a built-in function&#xa; all_names = GetSeriesNames()&#xa; filtered_names = {}&#xa; for i, name in ipairs(all_names) do&#xa; -- check the prefix&#xa; if name:find(prefix, 1, #prefix) then&#xa; table.insert(filtered_names, name);&#xa; end&#xa; end&#xa; return filtered_names&#xa;end&#xa;&#xa;--[[ Modify an existing series, applying offsets to all their X and Y values&#xa;&#xa; series: an existing timeseries, obtained with TimeseriesView.find(name)&#xa; delta_x: offset to apply to each x value&#xa; delta_y: offset to apply to each y value &#xa; &#xa;--]]&#xa;&#xa;function ApplyOffsetInPlace(series, delta_x, delta_y)&#xa; -- use C++ indeces, not Lua indeces&#xa; for index=0, series:size()-1 do&#xa; x,y = series:at(index)&#xa; series:set(index, x + delta_x, y + delta_y)&#xa; end&#xa;end&#xa;"/>
<scripts/>
</plugin>
<plugin ID="CSV Exporter"/>
</Plugins>
<!-- - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - -->
Expand Down

0 comments on commit 1854f70

Please sign in to comment.