Skip to content

Commit

Permalink
Merge branch 'main' into feature/jazzy-ubuntu2404-devcontainer
Browse files Browse the repository at this point in the history
  • Loading branch information
Flova authored Nov 23, 2024
2 parents 3c6dc0c + 89c7035 commit 00d6efa
Show file tree
Hide file tree
Showing 510 changed files with 512 additions and 356 deletions.
1 change: 0 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ RUN apt-get update -y \
tree \
uvcdynctrl \
vim \
vlc \
wget \
x11-apps \
zsh
Expand Down
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
"throwin",
"timespec",
"tldr",
"torqueless",
"tqdm",
"unpenalize",
"unpenalized",
Expand Down Expand Up @@ -212,7 +213,8 @@
"variant": "cpp",
"regex": "cpp",
"future": "cpp",
"*.ipp": "cpp"
"*.ipp": "cpp",
"span": "cpp"
},
// Tell the ROS extension where to find the setup.bash
// This also utilizes the COLCON_WS environment variable, which needs to be set
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<arg name="world_model" default="true" description="Whether the world model should be started"/>

<!-- load the general simulator -->
<include file="$(find-pkg-share wolfgang_webots_sim)/launch/simulation.launch" />
<include file="$(find-pkg-share bitbots_webots_sim)/launch/simulation.launch" />

<!-- load teamplayer software stack -->
<include file="$(find-pkg-share bitbots_bringup)/launch/teamplayer.launch">
Expand Down
2 changes: 1 addition & 1 deletion bitbots_misc/bitbots_bringup/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<depend>bitbots_docs</depend>

<exec_depend condition="$IS_ROBOT != True">wolfgang_webots_sim</exec_depend>
<exec_depend condition="$IS_ROBOT != True">bitbots_webots_sim</exec_depend>
<exec_depend>audio_common</exec_depend>
<exec_depend>bitbots_basler_camera</exec_depend>
<exec_depend>bitbots_body_behavior</exec_depend>
Expand Down
6 changes: 3 additions & 3 deletions bitbots_misc/bitbots_containers/hlvs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ RUN cd src/bitbots_main && \
make pull-all && \
rm -rf lib/udp_bridge bitbots_misc/bitbots_containers \
lib/dynamic_stack_decider/dynamic_stack_decider_visualization bitbots_lowlevel \
bitbots_wolfgang/wolfgang_pybullet_sim lib/DynamixelSDK lib/dynamixel-workbench \
bitbots_robot/bitbots_pybullet_sim lib/DynamixelSDK lib/dynamixel-workbench \
bitbots_misc/bitbots_basler_camera && \
sed -i '/plotjuggler/d' bitbots_motion/bitbots_quintic_walk/package.xml && \
sed -i '/run_depend/d' bitbots_wolfgang/wolfgang_moveit_config/package.xml
sed -i '/run_depend/d' bitbots_robot/wolfgang_moveit_config/package.xml

# Install ros dependencies with rosdep
RUN sudo apt update && rosdep update
Expand All @@ -75,7 +75,7 @@ RUN . /opt/ros/iron/setup.sh && colcon build --cmake-args -DBUILD_TESTING=OFF

# TODO execute tests

RUN cp src/bitbots_main/bitbots_wolfgang/wolfgang_robocup_api/scripts/start.sh .local/bin/start
RUN cp src/bitbots_main/bitbots_robot/bitbots_robocup_api/scripts/start.sh .local/bin/start

# Volume for logs
VOLUME /robocup-logs
Expand Down
2 changes: 1 addition & 1 deletion bitbots_misc/bitbots_docs/docs/manual/testing/sim_test.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Test Motion

.. code-block:: bash
ros2 launch wolfgang_webots_sim simulation.launch
ros2 launch bitbots_webots_sim simulation.launch
ros2 launch bitbots_bringup motion_standalone.launch sim:=true
To control walking of the robot, teleop needs to be startet as well:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,19 @@ As such you can lookup some of the needed requirements there.
**0. Requirements**

- have an LDAP mafiasi account for access to the CLs
- have ros2 aliases setup (see linked docs)
- have GitHub ssh access setup for bitbots_main (see linked docs)

**1. Setup and download our software**

- SSH into the ``cl0*`` with your mafiasi user
- Add your SSH key to GitHub to access and sync our repositories
- If you don't know what I am talking about or you don't yet have a SSH key, follow this guide: https://docs.github.com/en/authentication/connecting-to-github-with-ssh/checking-for-existing-ssh-keys
- Go to your account settings and add your SSH key (the ``.pub`` file) to `GitHub <https://github.com/settings/keys>`_
- setup bitbots_main in your home directory

.. code-block:: bash
mkdir -p "~/colcon_ws/src"
cd "~/colcon_ws/src"
mkdir -p "$HOME/colcon_ws/src"
cd "$HOME/colcon_ws/src"
git clone git@github.com:bit-bots/bitbots_main.git && cd bitbots_main
make install-no-root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ If you want to install it, you can do so by running ``make webots`` in the bitbo

**3. Download our software**

- Create a GitHub account, if not already done (see `here <http://doku.bit-bots.de/private/manual/dienste_accounts.html>` for further information)
- Create a GitHub account, if not already done (see `here <http://doku.bit-bots.de/private/manual/dienste_accounts.html>`_ for further information)
- Add your SSH key to GitHub to access and sync our repositories
- If you don't know what I am talking about or you don't yet have a SSH key, follow this guide: https://docs.github.com/en/authentication/connecting-to-github-with-ssh/checking-for-existing-ssh-keys
- Go to your account settings and add your SSH key (the ``.pub`` file) to `GitHub <https://github.com/settings/keys>`_
Expand Down Expand Up @@ -137,6 +137,8 @@ In case you are not using the bash shell, replace ``~/.bashrc`` and ``bash`` wit
EOF
source ~/.bashrc
- Configure the robot hostnames, see :doc:`configure_hostnames`.
Notes
Expand Down
2 changes: 2 additions & 0 deletions bitbots_misc/system_monitor/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ system_monitor:

# These settings are quick_switches to completely disable certain parts of statistic collection
do_cpu: true
do_gpu: true
do_memory: true
do_network: false

# these are the threshold values at which we start going into a warn state
cpu_load_percentage: 80.0
gpu_load_percentage: 95.0
memory_load_percentage: 80.0
network_rate_received_errors: 10.0
network_rate_send_errors: 10.0
176 changes: 79 additions & 97 deletions bitbots_misc/system_monitor/config/plotjuggler_layout.xml
Original file line number Diff line number Diff line change
@@ -1,139 +1,120 @@
<?xml version='1.0' encoding='UTF-8'?>
<root version="2.3.8">
<tabbed_widget name="Main Window" parent="main_window">
<plotmatrix rows="2" columns="1" tab_name="CPU">
<plot row="0" col="0">
<range top="100.000000" bottom="0.000000" left="0.000000" right="8.029071"/>
<limitY max="100" min="0"/>
<curve custom_transform="noTransform" name="/system_workload/cpus.0/cpu_usage" B="180" G="119" R="31"/>
<curve custom_transform="noTransform" name="/system_workload/cpus.1/cpu_usage" B="40" G="39" R="214"/>
<curve custom_transform="noTransform" name="/system_workload/cpus.2/cpu_usage" B="56" G="201" R="26"/>
<curve custom_transform="noTransform" name="/system_workload/cpus.3/cpu_usage" B="14" G="127" R="255"/>
<curve custom_transform="noTransform" name="/system_workload/cpus.4/cpu_usage" B="193" G="76" R="241"/>
<curve custom_transform="noTransform" name="/system_workload/cpus.5/cpu_usage" B="189" G="103" R="148"/>
<curve custom_transform="noTransform" name="/system_workload/cpus.6/cpu_usage" B="207" G="190" R="23"/>
<curve custom_transform="noTransform" name="/system_workload/cpus.7/cpu_usage" B="34" G="189" R="188"/>
<transform value="noTransform"/>
</plot>
<plot row="1" col="0">
<range top="279.000000" bottom="1.000000" left="0.000000" right="8.029071"/>
<limitY min="1"/>
<curve custom_transform="noTransform" name="/system_workload/running_processes" B="180" G="119" R="31"/>
<transform value="noTransform"/>
</plot>
</plotmatrix>
<plotmatrix rows="1" columns="1" tab_name="Memory">
<plot row="0" col="0">
<range top="16662851584.000000" bottom="0.000000" left="0.000000" right="0.518927"/>
<limitY min="0"/>
<curve custom_transform="noTransform" name="/system_workload/memory_total" B="40" G="39" R="214"/>
<curve custom_transform="noTransform" name="/system_workload/memory_used" B="180" G="119" R="31"/>
<transform value="noTransform"/>
</plot>
</plotmatrix>
<plotmatrix rows="1" columns="1" tab_name="Network">
<plot row="0" col="0">
<range top="24198.000000" bottom="0.000000" left="0.000000" right="4.023767"/>
<limitY min="0"/>
<curve custom_transform="noTransform" name="/system_workload/network_interfaces.0/rate_received_bytes" B="180" G="119" R="31"/>
<curve custom_transform="noTransform" name="/system_workload/network_interfaces.0/rate_sent_bytes" B="40" G="39" R="214"/>
<curve custom_transform="noTransform" name="/system_workload/network_interfaces.1/rate_received_bytes" B="56" G="201" R="26"/>
<curve custom_transform="noTransform" name="/system_workload/network_interfaces.1/rate_sent_bytes" B="14" G="127" R="255"/>
<transform value="noTransform"/>
</plot>
</plotmatrix>
<currentPlotMatrix index="0"/>
<root>
<tabbed_widget parent="main_window" name="Main Window">
<Tab tab_name="tab2" containers="1">
<Container>
<DockSplitter count="3" sizes="0.332999;0.334002;0.332999" orientation="-">
<DockArea name="...">
<plot flip_x="false" style="Lines" flip_y="false" mode="TimeSeries">
<range right="1730744413.650088" bottom="-0.211458" left="1730744393.723256" top="8.669791"/>
<limitY/>
<curve color="#bcbd22" name="/system_workload/cpu_usage_overall"/>
</plot>
</DockArea>
<DockArea name="...">
<plot flip_x="false" style="Lines" flip_y="false" mode="TimeSeries">
<range right="1730744413.650088" bottom="3674476441.600006" left="1730744393.723256" top="138214342758.399994"/>
<limitY/>
<curve color="#1f77b4" name="/system_workload/memory_used"/>
<curve color="#d62728" name="/system_workload/memory_total"/>
</plot>
</DockArea>
<DockArea name="...">
<plot flip_x="false" style="Lines" flip_y="false" mode="TimeSeries">
<range right="1730744413.650088" bottom="576.850000" left="1730744393.723256" top="583.150000"/>
<limitY/>
<curve color="#1ac938" name="/system_workload/running_processes"/>
</plot>
</DockArea>
</DockSplitter>
</Container>
</Tab>
<currentTabIndex index="0"/>
</tabbed_widget>
<use_relative_time_offset enabled="1"/>
<use_relative_time_offset enabled="0"/>
<!-- - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - -->
<Plugins>
<plugin ID="DataLoad CSV">
<default time_axis=""/>
<parameters delimiter="0" time_axis=""/>
</plugin>
<plugin ID="DataLoad ROS bags">
<plugin ID="DataLoad MCAP"/>
<plugin ID="DataLoad ROS2 bags">
<use_header_stamp value="false"/>
<use_renaming_rules value="true"/>
<discard_large_arrays value="true"/>
<max_array_size value="100"/>
<boolean_strings_to_number value="true"/>
<remove_suffix_from_strings value="true"/>
<selected_topics value=""/>
</plugin>
<plugin ID="DataLoad ULog"/>
<plugin ID="ROS Topic Subscriber">
<use_header_stamp value="false"/>
<use_renaming_rules value="true"/>
<plugin ID="ROS2 Topic Subscriber">
<use_header_stamp value="true"/>
<discard_large_arrays value="true"/>
<max_array_size value="100"/>
<boolean_strings_to_number value="true"/>
<remove_suffix_from_strings value="true"/>
<selected_topics value="/system_workload"/>
</plugin>
<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="ROS /rosout Visualization" status="idle"/>
<plugin ID="ROS Topic Re-Publisher" status="idle"/>
<plugin ID="CSV Exporter"/>
<plugin ID="ROS2 Topic Re-Publisher"/>
</Plugins>
<!-- - - - - - - - - - - - - - - -->
<previouslyLoaded_Datafiles/>
<previouslyLoaded_Streamer name="ROS Topic Subscriber"/>
<previouslyLoaded_Streamer name="ROS2 Topic Subscriber"/>
<!-- - - - - - - - - - - - - - - -->
<customMathEquations/>
<snippets>
<snippet name="1st_derivative" language="JS">
<snippet name="1st_derivative">
<global>var prevX = 0
var prevY = 0</global>
<equation>dx = time - prevX
dy = value - prevY
prevX = time
prevY = value

return dy/dx</equation>
<function></function>
<linked_source></linked_source>
</snippet>
<snippet name="1st_order_lowpass" language="JS">
<snippet name="1st_order_lowpass">
<global>var prevY = 0
var alpha = 0.1</global>
<equation>prevY = alpha * value + (1.-alpha) * prevY

return prevY</equation>
<function></function>
<linked_source></linked_source>
</snippet>
<snippet name="2D_velocity" language="JS">
<snippet name="2D_velocity">
<global>var prev_x = 0
var prev_y = 0
var prev_t = 0</global>
<equation>X = $$your_odometry/position/x$$
Y = $$your_odometry/position/y$$

var dist = sqrt( (X-prev_x)*(X-prev_x) + (Y-prev_y)*(Y-prev_y) )
var dT = time - prev_t

prev_x = X
prev_y = Y
prev_t = time

return dist / dT</equation>
<function></function>
<linked_source></linked_source>
</snippet>
<snippet name="average_two_curves" language="JS">
<snippet name="average_two_curves">
<global></global>
<equation>a = $$PLOT_A$$
b = $$PLOT_B$$

return (a+b)/2</equation>
<function></function>
<linked_source></linked_source>
</snippet>
<snippet name="integral" language="JS">
<snippet name="integral">
<global>var integral = 0</global>
<equation>integral += value
return integral</equation>
<function></function>
<linked_source></linked_source>
</snippet>
<snippet name="rad_to_deg" language="JS">
<snippet name="rad_to_deg">
<global></global>
<equation>return value*180/3.1417</equation>
<function></function>
<linked_source></linked_source>
</snippet>
<snippet name="remove_offset" language="JS">
<snippet name="remove_offset">
<global>var is_first = true
var first_value = 0</global>
<equation>if (is_first)
{
is_first = false
first_value = value
}

return value - first_value</equation>
<function></function>
<linked_source></linked_source>
</snippet>
<snippet name="yaw_from_quaternion" language="JS">
<snippet name="yaw_from_quaternion">
<global>// source: https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles

function quaternionToYaw(x, y, z, w)
Expand All @@ -145,7 +126,8 @@ function quaternionToYaw(x, y, z, w)

return yaw
}</global>
<equation>return quaternionToYaw(x, y, z, w);</equation>
<function></function>
<linked_source></linked_source>
</snippet>
</snippets>
<!-- - - - - - - - - - - - - - - -->
Expand Down
2 changes: 1 addition & 1 deletion bitbots_misc/system_monitor/launch/viz.launch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<launch>
<node pkg="plotjuggler" exec="plotjuggler" name="$(anon plotjuggler)" output="screen" required="true"
<node pkg="plotjuggler" exec="plotjuggler" name="$(anon plotjuggler)" output="screen"
args="--layout $(find-pkg-share system_monitor)/config/plotjuggler_layout.xml"/>
</launch>
2 changes: 1 addition & 1 deletion bitbots_misc/system_monitor/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<depend>python3-psutil</depend>
<depend>bitbots_docs</depend>
<depend>rclpy</depend>
<depend>bitbots_msgs</depend>
<depend>bitbots_msgs</depend>

<export><build_type>ament_python</build_type>
</export>
Expand Down
2 changes: 2 additions & 0 deletions bitbots_misc/system_monitor/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
("share/" + package_name, ["package.xml"]),
("share/ament_index/resource_index/packages", ["resource/" + package_name]),
("share/" + package_name + "/config", glob.glob("config/*.yaml")),
("share/" + package_name + "/config", glob.glob("config/*.rviz")),
("share/" + package_name + "/config", glob.glob("config/*.xml")),
("share/" + package_name + "/launch", glob.glob("launch/*.launch")),
],
install_requires=[
Expand Down
3 changes: 2 additions & 1 deletion bitbots_misc/system_monitor/system_monitor/cpus.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ def collect_all():
def _get_cpu_stats():
"""
read and parse /proc/stat
:returns timings which contains accumulative busy and total cpu time
:returns: timings which contains accumulative busy and total cpu time
"""
timings = {}
with open("/proc/stat") as file_obj:
Expand Down
Loading

0 comments on commit 00d6efa

Please sign in to comment.