Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Cyclone DDS #60

Merged
merged 3 commits into from
Jul 16, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions scripts/source_obelisk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,27 @@ else
printf '\n%s\n%s\n%s\n' "$start_marker" "$cmd" "$end_marker" >> ~/.bashrc
fi

# makes cyclone DDS the default ROS2 middleware
cmd_local='if which python | grep -q ".pixi"; then
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
fi'
cmd_global='export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp'
start_marker="# >>> make cyclone DDS the rmw default >>>"
end_marker="# <<< make cyclone DDS the rmw default <<<"
if [ "$GLOBAL" == "true" ]; then
cmd="$cmd_global"
else
cmd="$cmd_local"
fi
if grep -Fq "$start_marker" ~/.bashrc && grep -Fq "$end_marker" ~/.bashrc; then
awk -v start="$start_marker" -v end="$end_marker" -v cmd="$cmd" '
$0 == start {print; print cmd; f=1; next}
$0 == end {f=0}
!f
' ~/.bashrc > ~/.bashrc.tmp && cp ~/.bashrc.tmp ~/.bashrc && rm ~/.bashrc.tmp
else
printf '\n%s\n%s\n%s\n' "$start_marker" "$cmd" "$end_marker" >> ~/.bashrc
fi

source ~/.bashrc
echo -e "\033[1;32mObelisk sourced!\033[0m"