This repository was archived by the owner on Nov 26, 2024. It is now read-only.
forked from alexseysua/flight_stack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommands.sh
More file actions
52 lines (44 loc) · 1.56 KB
/
commands.sh
File metadata and controls
52 lines (44 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env bash
# Project-specific shell functions and commands.
#
# Roberto Masocco <r.masocco@dotxautomation.com>
#
# June 13, 2024
# Copyright 2024 dotX Automation s.r.l.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Add yours, some convenient ones are provided below.
# You can also source other files from sub-units included by this project.
# shellcheck disable=SC1090
# Source DUA commands
source ~/.dua_submod.sh
source ~/.dua_subtree.sh
# Routine to convert an angle in degrees [-180° +180°] to radians [-PI +PI].
function degrad {
local angle_in_degrees="$1"
angle_in_radians=$(python3 -c "import sys, math; angle=float(sys.argv[1]); print(math.radians((angle + 180) % 360 - 180))" "$angle_in_degrees")
echo "$angle_in_radians"
}
# Routine to update dua-utils.
function utils-update {
CURR_SHELL=$(ps -p $$ | awk 'NR==2 {print $4}')
pushd || return
cd /opt/ros/dua-utils || return
git pull
git submodule update --init --recursive
rm -rf install
colcon build --merge-install
rm -rf build log
source "install/local_setup.$CURR_SHELL"
popd || return
}