Skip to content

Commit 45f6536

Browse files
committed
Merge branch 'main' into docker
2 parents 1fcecb6 + ccfa5b1 commit 45f6536

File tree

168 files changed

+8099
-2940
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+8099
-2940
lines changed

Docker.md

Lines changed: 0 additions & 85 deletions
This file was deleted.

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
3535
ros-humble-xacro \
3636
ros-humble-rosidl-default-generators \
3737
ros-humble-rosidl-default-runtime \
38+
ros-humble-robot-localization \
39+
ros-humble-imu-filter-madgwick \
40+
ros-humble-phidgets-spatial \
3841
&& rm -rf /var/lib/apt/lists/*
3942

4043
WORKDIR $ROVERFLAKE_ROOT

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
2023 - Present ROS2 repo for rover
33
RoverFlake1 is old.
44

5+
### Other documentation
6+
[Live view doc to consolidate block diagrams, setup procedures, and more](https://viewer.diagrams.net/?tags=%7B%7D&lightbox=1&highlight=0000ff&edit=_blank&layers=1&nav=1&title=RoverStartupEverything.drawio&dark=1#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D1oTCJmi5VluUgLIwTO4EpU9Yp7SvRvJsf%26export%3Ddownload)
7+
58
### Setting up this repo on your computer
69
_Reccomended/Required: Ubuntu 22.04_
710

docker-compose.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,70 @@ services:
2222
working_dir: /RoverFlake2
2323
tty: true
2424
stdin_open: true
25+
privileged: true
2526
volumes: # Purpose: docker env watches for changes in repo and updates
2627
# preferred method is to specify a directory
2728
# e.g. '- ./node_practice:/RoverFlake2/node_practice'
2829
# Bind-mount the whole repo into the container
2930
- ./:/RoverFlake2
31+
- /dev:/dev # Pass through USB devices (e.g. Phidgets IMU)
32+
- /tmp/.X11-unix:/tmp/.X11-unix # GUI support
3033
environment:
3134
- ROVERFLAKE_ROOT=/RoverFlake2
35+
- DISPLAY=${DISPLAY}
36+
network_mode: host
37+
rover_ros: # GUI support + NVIDIA GPU support
38+
container_name: rover_gpu
39+
image: roverflake2:gpu
40+
working_dir: /RoverFlake2
41+
build:
42+
context: .
43+
dockerfile: Dockerfile
44+
runtime: nvidia
45+
privileged: true
46+
environment:
47+
- DISPLAY=${DISPLAY}
48+
- XAUTHORITY=/tmp/.docker.xauth # auto accept
49+
- ROVERFLAKE_ROOT=/RoverFlake2
50+
- NVIDIA_VISIBLE_DEVICES=all
51+
- NVIDIA_DRIVER_CAPABILITIES=all
52+
- __GLX_VENDOR_LIBRARY_NAME=nvidia
53+
volumes:
54+
- ./:/RoverFlake2
55+
- /tmp/.X11-unix:/tmp/.X11-unix
56+
- /tmp/.docker.xauth:/tmp/.docker.xauth
57+
- /dev:/dev # Pass through all devices (USB, etc.)
58+
devices:
59+
- /dev/serial/by-id:/dev/serial/by-id # Pass through USB devices by ID (e.g. Phidgets IMU)
60+
deploy:
61+
resources:
62+
reservations:
63+
devices:
64+
- driver: nvidia
65+
count: all
66+
capabilities: [gpu]
67+
tty: true
68+
stdin_open: true
69+
network_mode: host
70+
rover_x11: # Do not use if you don't have a nvidia GPU with supported cuda cores
71+
build:
72+
context: .
73+
dockerfile: Dockerfile
74+
image: roverflake2:dev
75+
container_name: rover_dev
76+
working_dir: /RoverFlake2
77+
tty: true
78+
stdin_open: true
79+
volumes: # Purpose: docker env watches for changes in repo and updates
80+
# preferred method is to specify a directory
81+
# e.g. '- ./node_practice:/RoverFlake2/node_practice'
82+
# Bind-mount the whole repo into the container
83+
- ./:/RoverFlake2
84+
- /tmp/.X11-unix:/tmp/.X11-unix # GUI compatibility
85+
environment:
86+
- DISPLAY=${DISPLAY}
87+
- ROVERFLAKE_ROOT=/RoverFlake2
88+
- MUJOCO_GL=glfw # or egl (headless GUI)
3289
network_mode: host
3390
rover_gpu: # GUI support + NVIDIA GPU support
3491
container_name: rover_gpu
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Auto-select DDS interface
2+
if ip addr show eno1 | grep -q "192.168.1.50"; then
3+
export CYCLONEDDS_URI=file:///home/rv/RoverFlake2/network_stuff/dds_main.xml
4+
elif ip addr show ztc3qyu2l6 | grep -q "172.30.0.21"; then
5+
export CYCLONEDDS_URI=file:///home/rv/RoverFlake2/network_stuff/dds_fallback.xml
6+
else
7+
# Fallback to auto-determine
8+
export CYCLONEDDS_URI='<CycloneDDS><Domain><General><Interfaces><NetworkInterface autodetermine="true"/></Interfaces></General></Domain></CycloneDDS>'
9+
fi
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<root>
3+
<tabbed_widget name="Main Window" parent="main_window">
4+
<Tab containers="1" tab_name="CONFIGS">
5+
<Container>
6+
<DockSplitter orientation="-" count="1" sizes="1">
7+
<DockArea name="...">
8+
<plot flip_y="false" flip_x="false" mode="TimeSeries" line_width="1.0">
9+
<range bottom="-0.200000" left="33.517104" top="8.200000" right="93.485880"/>
10+
<limitY/>
11+
<curve color="#1f77b4" name="/arm/moteus_feedback/config[0]/max_current_amps"/>
12+
<curve color="#d62728" name="/arm/moteus_feedback/config[1]/max_current_amps"/>
13+
<curve color="#1ac938" name="/arm/moteus_feedback/config[2]/max_current_amps"/>
14+
<curve color="#ff7f0e" name="/arm/moteus_feedback/config[3]/max_current_amps"/>
15+
<curve color="#f14cc1" name="/arm/moteus_feedback/config[4]/max_current_amps"/>
16+
<curve color="#9467bd" name="/arm/moteus_feedback/config[5]/max_current_amps"/>
17+
<curve color="#17becf" name="/arm/moteus_feedback/config[6]/max_current_amps"/>
18+
</plot>
19+
</DockArea>
20+
</DockSplitter>
21+
</Container>
22+
</Tab>
23+
<Tab containers="1" tab_name="tab2">
24+
<Container>
25+
<DockSplitter orientation="-" count="2" sizes="0.500426;0.499574">
26+
<DockArea name="TORQUE">
27+
<plot flip_y="false" flip_x="false" mode="TimeSeries" line_width="1.0">
28+
<range bottom="-0.880068" left="33.517104" top="0.829475" right="93.485880"/>
29+
<limitY/>
30+
<curve color="#bcbd22" name="/arm/moteus_feedback/status[0]/curr_torque"/>
31+
<curve color="#1f77b4" name="/arm/moteus_feedback/status[1]/curr_torque"/>
32+
<curve color="#d62728" name="/arm/moteus_feedback/status[2]/curr_torque"/>
33+
<curve color="#1ac938" name="/arm/moteus_feedback/status[3]/curr_torque"/>
34+
<curve color="#ff7f0e" name="/arm/moteus_feedback/status[4]/curr_torque"/>
35+
<curve color="#f14cc1" name="/arm/moteus_feedback/status[5]/curr_torque"/>
36+
<curve color="#9467bd" name="/arm/moteus_feedback/status[6]/curr_torque"/>
37+
</plot>
38+
</DockArea>
39+
<DockArea name="POSITION">
40+
<plot flip_y="false" flip_x="false" mode="TimeSeries" line_width="1.0">
41+
<range bottom="-0.001633" left="33.517104" top="0.024643" right="93.485880"/>
42+
<limitY/>
43+
<curve color="#17becf" name="/arm/moteus_feedback/status[0]/curr_position"/>
44+
<curve color="#bcbd22" name="/arm/moteus_feedback/status[1]/curr_position"/>
45+
<curve color="#1f77b4" name="/arm/moteus_feedback/status[2]/curr_position"/>
46+
<curve color="#d62728" name="/arm/moteus_feedback/status[3]/curr_position"/>
47+
<curve color="#1ac938" name="/arm/moteus_feedback/status[4]/curr_position"/>
48+
<curve color="#ff7f0e" name="/arm/moteus_feedback/status[5]/curr_position"/>
49+
<curve color="#f14cc1" name="/arm/moteus_feedback/status[6]/curr_position"/>
50+
</plot>
51+
</DockArea>
52+
</DockSplitter>
53+
</Container>
54+
</Tab>
55+
<currentTabIndex index="1"/>
56+
</tabbed_widget>
57+
<use_relative_time_offset enabled="1"/>
58+
<!-- - - - - - - - - - - - - - - -->
59+
<!-- - - - - - - - - - - - - - - -->
60+
<Plugins>
61+
<plugin ID="DataLoad CSV">
62+
<parameters time_axis="" delimiter="0"/>
63+
</plugin>
64+
<plugin ID="DataLoad MCAP"/>
65+
<plugin ID="DataLoad ROS2 bags">
66+
<use_header_stamp value="false"/>
67+
<discard_large_arrays value="true"/>
68+
<max_array_size value="100"/>
69+
<boolean_strings_to_number value="true"/>
70+
<remove_suffix_from_strings value="true"/>
71+
<selected_topics value=""/>
72+
</plugin>
73+
<plugin ID="DataLoad ULog"/>
74+
<plugin ID="ROS2 Topic Subscriber">
75+
<use_header_stamp value="false"/>
76+
<discard_large_arrays value="true"/>
77+
<max_array_size value="100"/>
78+
<boolean_strings_to_number value="true"/>
79+
<remove_suffix_from_strings value="true"/>
80+
<selected_topics value="/arm/moteus_feedback"/>
81+
</plugin>
82+
<plugin ID="UDP Server"/>
83+
<plugin ID="WebSocket Server"/>
84+
<plugin ID="ZMQ Subscriber"/>
85+
<plugin ID="Fast Fourier Transform"/>
86+
<plugin ID="Quaternion to RPY"/>
87+
<plugin ID="Reactive Script Editor">
88+
<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++ indices, not Lua indices&#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;"/>
89+
<scripts/>
90+
</plugin>
91+
<plugin ID="CSV Exporter"/>
92+
<plugin ID="ROS2 Topic Re-Publisher"/>
93+
</Plugins>
94+
<!-- - - - - - - - - - - - - - - -->
95+
<previouslyLoaded_Datafiles/>
96+
<previouslyLoaded_Streamer name="ROS2 Topic Subscriber"/>
97+
<!-- - - - - - - - - - - - - - - -->
98+
<customMathEquations/>
99+
<snippets/>
100+
<!-- - - - - - - - - - - - - - - -->
101+
</root>
102+

setup_scripts/env_source.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,10 @@
22
source /opt/ros/humble/setup.bash
33
source /home/${USER}/RoverFlake2/install/setup.bash
44
source /home/${USER}/RoverFlake2/network_stuff/cyclonedds_env.sh
5+
6+
7+
# gui apps
8+
export DISPLAY=:0
9+
export XAUTHORITY="/run/user/1001/gdm"
10+
export ROVERFLAKE_ROOT="/home/rv/RoverFlake2/"
11+
source /home/rv/RoverFlake2/setup_scripts/rover_env/cbs_env_setup.sh

setup_scripts/install_libsweepsdk.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ mkdir -p build
1111
cd build
1212

1313
# build and install the libsweep library
14-
cmake .. -DCMAKE_BUILD_TYPE=Release
14+
echo CONFIGUIRING SWEEPSDK
15+
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_POLICY_VERSION_MINIMUM=3.5
16+
echo BUILDNG SWEEP
1517
cmake --build .
1618
sudo cmake --build . --target install
1719
sudo ldconfig

setup_scripts/setup_everything_common.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ echo This script will NOT install discord. run install-discord.sh if you want di
3333
sleep 1.0
3434
echo starting with ros2...
3535

36-
#sudo apt update
36+
sudo apt update
3737
cd $ROVERFLAKE_ROOT/setup_scripts/
3838
bash install_dependencies.sh
3939
bash install-ros2-humble.sh # also runs apt update, if ros2 is not installed
@@ -67,13 +67,8 @@ done
6767
cd $ROVERFLAKE_ROOT
6868

6969
source /opt/ros/humble/setup.bash
70-
#install ros2 packages
71-
sudo rosdep init
72-
rosdep update
73-
bash setup_scripts/install_rosdeps.sh
74-
7570
# setup user enviroment
76-
mkdir ${ROVERFLAKE_ROOT}/random_install_files
71+
mkdir -p ${ROVERFLAKE_ROOT}/random_install_files
7772
echo "source ${ROVERFLAKE_ROOT}/setup_scripts/rover_env/rover_env_common.sh " >> ~/.bashrc
7873

7974

@@ -85,6 +80,13 @@ cd ${ROVERFLAKE_ROOT}
8580
bash setup_scripts/submodule_update.sh
8681

8782

83+
#install ros2 packages
84+
sudo rosdep init
85+
rosdep update
86+
bash setup_scripts/install_rosdeps.sh
87+
88+
89+
8890

8991

9092
# for package in "${ros_packages_to_install[@]}"; do

0 commit comments

Comments
 (0)