Created
August 21, 2025 06:33
-
-
Save guillaumefalvet/2b78d39668b5988f7a45cb0c39dc6129 to your computer and use it in GitHub Desktop.
HMI ZSH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # source ~/powerlevel10k/powerlevel10k.zsh-theme | |
| PATH=$PATH:$HOME/.local/bin | |
| export ZSH="$HOME/.oh-my-zsh" | |
| # set by `omz` | |
| ZSH_THEME="robbyrussell" # set by `omz` | |
| # ZSH_THEME="powerlevel10k/powerlevel10k" | |
| plugins=(git zsh-autosuggestions) | |
| alias ffs="sudo sysctl fs.inotify.max_user_watches=131070" | |
| source $ZSH/oh-my-zsh.sh | |
| source ~/zsh-autocomplete/zsh-autocomplete.plugin.zsh | |
| source ~/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh | |
| source /opt/ros/humble/setup.zsh | |
| eval $(thefuck --alias) | |
| eval $(thefuck --alias FUCK) | |
| # GENERAL OPTIONS | |
| export __GLX_VENDOR_LIBRARY_NAME=nvidia | |
| export __NV_PRIME_RENDER_OFFLOAD=1 | |
| alias python=python3 | |
| export NODE_OPTIONS=--max_old_space_size=10000 | |
| # --- FORSSEA OPTIONS --- # | |
| export GZ_VERSION=harmonic | |
| export ROS_DOMAIN_ID=77 | |
| # --- POSTGRES OPTIONS --- # | |
| export PGPASSWORD='postgres' | |
| export PGHOST='localhost' | |
| export PGUSER='postgres' | |
| # export PGDATABASE='postgres' | |
| export PGPORT='5432' | |
| package_cleanup () { | |
| rm -rf node_modules/@forssea_robotics dist package-lock.json .angular | |
| } | |
| package_cleanup_hard () { | |
| rm -rf node_modules dist package-lock.json .angular | |
| } | |
| # Function to start Verdaccio package registry server | |
| start_verdaccio() { | |
| echo "\033[32mStarting verdaccio...\033[00m" | |
| verdaccio --listen 0.0.0.0:4873 | |
| } | |
| # Function to remove and reinstall Firefox using snap and apt | |
| firefox_clean() { | |
| sudo snap remove firefox | |
| # wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null | |
| sudo apt install firefox | |
| } | |
| vscode_clean(){ | |
| sudo snap remove code | |
| sudo snap install --revision 159 --classic code | |
| } | |
| # Function to switch to the 'develop' branch in Git | |
| gitd() { | |
| git checkout develop | |
| } | |
| # Function to push changes to Git while skipping CI/CD pipeline | |
| gitci() { | |
| git push -o ci.skip | |
| } | |
| git_branch_clean_up() { | |
| git branch | grep -v 'main\|master' | xargs git branch -d | |
| } | |
| # Function to kill all running Node.js processes | |
| kill_all_node() { | |
| killall node | |
| } | |
| # Alias to open the .zshrc file in Visual Studio Code | |
| alias zsh_config="code ~/.zshrc" | |
| alias reload="omz reload" | |
| # Alias to open the Espanso configuration file in Visual Studio Code | |
| alias espanso_config="code /home/gfalvet/.config/espanso/match" | |
| # Alias to open the Oh My Zsh configuration file in Visual Studio Code | |
| alias ohmyzsh="code ~/.oh-my-zsh" | |
| # Alias to open the current directory in Nautilus file manager | |
| alias opn="nautilus -s ." | |
| alias usage="htop" | |
| alias ramusage_basic="free -h" | |
| alias cpuusage="top" | |
| alias watcher="sudo sysctl -w fs.inotify.max_user_watches=524288" | |
| alias node_urls="python3 /home/gfalvet/.config/espanso/match/all_url.py" | |
| alias npmi="npm i --verbose" | |
| print_hmi_env_info() { | |
| echo "\033[34mHMI env path info.\033[00m" | |
| echo "PATH_TO_ROS_CONTROLLERS_CONFIG =" $PATH_TO_ROS_CONTROLLERS_CONFIG | |
| echo "PATH_TO_ROS_SPE75_HW_CONFIG =" $PATH_TO_ROS_SPE75_HW_CONFIG | |
| echo "SYSTEM_TEMPERATURE_FILE =" $SYSTEM_TEMPERATURE_FILE | |
| echo "SYSTEM_PRESSURE_FILE =" $SYSTEM_PRESSURE_FILE | |
| echo "NODE_OPTIONS=" $NODE_OPTIONS | |
| echo "DEVELOPER_MODE=" $DEVELOPER_MODE | |
| echo "PATH_TO_TOOLS_NAMES_MAPPING=" $PATH_TO_TOOLS_NAMES_MAPPING | |
| echo "HMI_AUTONOMY_TARGET_TOLERANCE_APPROXIMATED =" $HMI_AUTONOMY_TARGET_TOLERANCE_APPROXIMATED | |
| echo "HMI_AUTONOMY_TARGET_TOLERANCE_PRECISE =" $HMI_AUTONOMY_TARGET_TOLERANCE_PRECISE | |
| echo "PATH_TO_SOFTWARE_RELEASE_NAME =" $PATH_TO_SOFTWARE_RELEASE_NAME | |
| echo "PATH_TO_SOFTWARE_RELEASE_DESCRIPTION =" $PATH_TO_SOFTWARE_RELEASE_DESCRIPTION | |
| echo "PATH_TO_SOFTWARE_RELEASE_DATE =" $PATH_TO_SOFTWARE_RELEASE_DATE | |
| echo "PATH_TO_SOFTWARE_RELEASE_HMI_VERSION =" $PATH_TO_SOFTWARE_RELEASE_HMI_VERSION | |
| echo "PATH_TO_FLIGHT_RECORDER_FILES =" $PATH_TO_FLIGHT_RECORDER_FILES | |
| echo "PATH_TO_FEATURES_CONFIG =" $PATH_TO_FEATURES_CONFIG | |
| } | |
| source_workspace_vpvl(){ | |
| echo "\033[32mWorkspace vpvl sourced.\033[00m" | |
| source /opt/ros/humble/setup.zsh | |
| source /home/gfalvet/Develop/ws_vpvl_rov/install/setup.zsh | |
| } | |
| source_workspace(){ | |
| echo "\033[32mWorkspace sourced.\033[00m" | |
| source /opt/ros/humble/setup.zsh | |
| source /home/gfalvet/Develop/ws_frs_rov/install/setup.zsh | |
| } | |
| register_obscam_mocked() { | |
| slptool -s NETWORK register camera-controls.FORSSEA://127.0.0.1 "(x-grpc-port=0000),(x-grpc-web-port=0000),(x-serial-number=GUILLAUME_MOCKED),(x-name=GUILLAUME_MOCKED),(x-http-port=5000)" | |
| } | |
| run_obscam_mocked(){ | |
| echo "\033[32mObscam Server Mocked\033[00m" | |
| cd /home/gfalvet/Develop/camera/obscam_control/obscam_control_server | |
| export $(cat config/obscam_control_server.env) | |
| source_workspace | |
| flask run | |
| } | |
| print_node_version(){ | |
| node_version=$(node -v) | |
| echo "\033[32mNode version: $node_version\033[00m" | |
| } | |
| robot_hmi() { | |
| echo "\033[32mNode version: $node_version\033[00m" | |
| trap 'echo "\n\033[33mProcess interrupted with Control-C\033[00m"' INT | |
| local t=$1 | |
| case "$t" in | |
| "rovins"|"x") | |
| export PATH_TO_ROS_CONTROLLERS_CONFIG=/home/gfalvet/Develop/ws_frs_rov/install/share/argos_${t}_bringup/config/controllers.yaml | |
| export PATH_TO_ROS_SPE75_HW_CONFIG=/home/gfalvet/Develop/ws_frs_rov/install/share/argos_${t}_bringup/config/spe75_hw_node.yaml | |
| ;; | |
| *) | |
| echo "Error: Invalid type. Use 'rovins' or 'x'. Usage: robot_hmi rovins|x" | |
| return 1 | |
| ;; | |
| esac | |
| export SYSTEM_TEMPERATURE_FILE=/sys/class/thermal/thermal_zone0/temp | |
| export SYSTEM_PRESSURE_FILE=/sys/class/thermal/thermal_zone0/temp | |
| export NODE_OPTIONS=--max_old_space_size=10000 | |
| export DEVELOPER_MODE=true | |
| export HMI_AUTONOMY_TARGET_TOLERANCE_APPROXIMATED=0.2 | |
| export HMI_AUTONOMY_TARGET_TOLERANCE_PRECISE=0.05 | |
| export PATH_TO_TOOLS_NAMES_MAPPING=/home/gfalvet/Develop/ws_frs_rov/tools.json | |
| export PATH_TO_SOFTWARE_RELEASE_NAME=/home/gfalvet/Develop/ws_frs_rov/version_name | |
| export PATH_TO_SOFTWARE_RELEASE_DESCRIPTION=/home/gfalvet/Develop/ws_frs_rov/version_description | |
| export PATH_TO_SOFTWARE_RELEASE_DATE=/home/gfalvet/Develop/ws_frs_rov/version_date | |
| export PATH_TO_SOFTWARE_RELEASE_HMI_VERSION=/home/gfalvet/Develop/robot-hmi/package.json | |
| export PATH_TO_FLIGHT_RECORDER_FILES=/home/gfalvet/Develop/ws_frs_rov/snapshot | |
| export PATH_TO_FEATURES_CONFIG=/home/gfalvet/Develop/robot-hmi/featureFlagConfig.json | |
| export GAMEPAD_JOYSTICKS_THROTTLE_INTERVAL_MS=10 | |
| cd /home/gfalvet/Develop/robot-hmi | |
| rm -rf dist .angular | |
| source_workspace | |
| print_hmi_env_info | |
| npx ng run robot-hmi:serve-ssr | |
| } | |
| navcam-evo-hmi() { | |
| export SYSTEM_TEMPERATURE_FILE=/sys/class/thermal/thermal_zone0/temp | |
| export CPU_TEMPERATURE_FILE=/sys/devices/virtual/thermal/thermal_zone0/temp | |
| export GPU_TEMPERATURE_FILE=/sys/devices/virtual/thermal/thermal_zone1/temp | |
| export SYSTEM_PRESSURE_FILE=/sys/devices/virtual/thermal/thermal_zone1/temp | |
| export SYSTEM_HUMIDITY_FILE=/home/gfalvet/Develop/ws_vpvl_rov/humidity | |
| export DEVELOPER_MODE=true | |
| cd /home/gfalvet/Develop/navcam-evo-hmi | |
| npm run dev:ssr | |
| } | |
| hmi_cleanup() { | |
| package_cleanup | |
| source_workspace | |
| npm i --verbose && npx generate-ros-messages | |
| echo "\033[32mHMI cleaned up and ready to go!\033[00m" | |
| print_node_version | |
| } | |
| argos_run_all_headless(){ | |
| source_workspace | |
| rm -rf /tmp/*.yaml | |
| concurrently --names "controller,navigation,simulation" -c "bgBlue.bold,bgGreen.bold,bgMagenta.bold"\ | |
| "ros2 launch argos_rovins_bringup bringup.launch.xml simulated:=true updated_params_path:=/tmp"\ | |
| "ros2 run frs_navigation_bringup navigation_stack_node --ros-args -p use_sim_time:=true --params-file /home/gfalvet/Develop/ws_frs_rov/src/frs_navigation/frs_navigation_bringup/config/navigation.yaml" \ | |
| "gz sim ocean_argos_rovins.world -s -r" | |
| } | |
| argos_x_run_all_headless(){ | |
| source_workspace | |
| rm -rf /tmp/*.yaml | |
| concurrently --names "controller,navigation,simulation" -c "bgBlue.bold,bgGreen.bold,bgMagenta.bold"\ | |
| "ros2 launch argos_x_bringup bringup.launch.xml simulated:=true updated_params_path:=/tmp"\ | |
| "ros2 run frs_navigation_bringup navigation_stack_node --ros-args -p use_sim_time:=true --params-file /home/gfalvet/Develop/ws_frs_rov/src/frs_navigation/frs_navigation_bringup/config/navigation.yaml" \ | |
| "gz sim ocean_argos_x.world -s -r" | |
| } | |
| ros_rov_controller() { | |
| source_workspace | |
| rm -rf /tmp/*.yaml | |
| local t=$1 | |
| case "$t" in | |
| "rovins"|"x") | |
| ros2 launch argos_${t}_bringup bringup.launch.xml simulated:=true updated_params_path:=/tmp | |
| ;; | |
| *) | |
| echo "Error: Invalid type. Use 'rovins' or 'x'. Usage: ros_rov_controller rovins|x" | |
| return 1 | |
| ;; | |
| esac | |
| echo "\033[33mrov_controller stopped.\033[00m" | |
| } | |
| ros_stack_navigation() { | |
| source_workspace | |
| ros2 run frs_navigation_bringup navigation_stack_node --ros-args -p use_sim_time:=true --params-file /home/gfalvet/Develop/ws_frs_rov/src/frs_navigation/frs_navigation_bringup/config/navigation.yaml | |
| echo "\033[33mstack_navigation stopped.\033[00m" | |
| } | |
| ros_buckley_cp_probe(){ | |
| source_workspace | |
| # ros2 topic echo /cp_probe | |
| ros2 launch buckley_cp_probe test_launch.py mock:=true nmea_interface_name:=test_nmea_exporter_cp_probe | |
| echo "\033[33buckley_cp_probe stopped.\033[00m" | |
| } | |
| ros_nmea_interface(){ | |
| source_workspace | |
| # nc -u -l 1234 | |
| ros2 run nmea_interface nmea_exporter --ros-args -r __node:='nmea_exporter_test' -p nmea_ip_address:="127.0.0.1" -p nmea_port:=1234 -p data_format:='FRS,{heading:.2f},{roll:.2f},{pitch:.2f},{depth:.2f},{altimeter:.2f}' | |
| echo "\033[33margos_nmea stopped.\033[00m" | |
| } | |
| ros_behavior_stack(){ | |
| source_workspace | |
| ros2 run frs_behavior_bringup behavior_stack_node --ros-args --params-file /home/gfalvet/Develop/ws_frs_rov/src/frs_behavior/frs_behavior_bringup/config/behavior.yaml -p use_sim_time:=true | |
| echo "\033[33mfrs_behavior_bringup stopped.\033[00m" | |
| } | |
| ros_bag(){ | |
| source_workspace | |
| cd /home/gfalvet/Develop/ws_frs_rov/snapshot | |
| ros2 bag record --all --snapshot-mode | |
| # ros2 run frs_behavior_bringup behavior_stack_node --ros-args --params-file /home/gfalvet/Develop/ws_frs_rov/src/frs_behavior/frs_behavior_bringup/config/behavior.yaml -p use_sim_time:=true | |
| } | |
| ros_sim() { | |
| source_workspace | |
| local t=$1 | |
| case "$t" in | |
| "rovins"|"x") | |
| gz sim ocean_argos_${t}.world | |
| ;; | |
| *) | |
| echo "Error: Invalid type. Use 'rovins' or 'x'. Usage: ros_sim rovins|x" | |
| return 1 | |
| ;; | |
| esac | |
| echo "\033[33margos_sim stopped.\033[00m" | |
| } | |
| ros_foxglove() { | |
| source_workspace | |
| ros2 launch foxglove_bridge foxglove_bridge_launch.xml include_hidden:=true | |
| echo "\033[33mfoxglove stopped.\033[00m" | |
| } | |
| # TODO make a function that takes robot model in parameter and returns the corresponding world file | |
| # --- Headless simulation --- # | |
| _ros_sim() { | |
| source_workspace | |
| i | |
| echo "\033[32mHEADLESS.\033[00m" | |
| gz sim ocean.world -s -r | |
| echo "\033[33margos_sim stopped.\033[00m" | |
| } | |
| ros_record() { | |
| source_workspace | |
| ros2 bag record -a --storage mcap | |
| echo "\033[33mros_record stopped.\033[00m" | |
| } | |
| ros_monitor() { | |
| cd /home/gfalvet/Develop/ws_frs_rov | |
| ros2 run diagnostic_aggregator aggregator_node --ros-args --params-file src/robots/argos/argos_robot/argos_common_bringup/config/diagnostic_aggregator.yaml -r diagnostics_agg:=/alarms -r diagnostics_toplevel_state:=/alarms_toplevel_state | |
| echo "\033[33mros_monitor stopped.\033[00m" | |
| } | |
| ros_alarm() { | |
| source_workspace | |
| ros2 topic echo /alarms | |
| echo "\033[33mros_alarm stopped.\033[00m" | |
| } | |
| remote_robot(){ | |
| source_workspace | |
| export CYCLONEDDS_URI=file:////home/gfalvet/Develop/ws_frs_rov/cyclonedds_remote_config.xml | |
| export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp | |
| } | |
| # Function to create a formatted git commit message based on provided options | |
| # | |
| # This function takes in options such as type, scope, and message to generate a formatted git commit message. | |
| # It also provides the option for a dry run, where the commit command is displayed without actually committing. | |
| # The generated commit message follows a specific format: "<branch_name> <type> (<scope>): <message>" | |
| # If the scope is not provided, the commit message will only include the type. | |
| c() { | |
| # Function to parse the current git branch | |
| parse_git_branch() { | |
| git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/' | |
| } | |
| # -h for help | |
| # must use double quotes | |
| blue_color="\033[34m" | |
| green_color="\033[32m" | |
| red_color="\033[31m" | |
| yellow_color="\033[33m" | |
| end_color="\033[00m" | |
| # Initialize variables | |
| local type="" | |
| local scope="" | |
| local message="" | |
| local concat="" | |
| local dry_run=0 | |
| local OPTIND flag | |
| # Function to display help message | |
| show_help() { | |
| echo -e "${yellow_color}Usage: c -t \"type\" -s \"scope\" -m \"message\" [-d for dry run] [-h for help]${end_color}" | |
| echo -e ">> c -t \"feat\" -s \"HMI\" -m \"Your commit message here\"" | |
| echo -e "[Result: if the branch name is Feature/ROB-999] git commit -m \"feat(HMI): ROB-999 Your commit message here\"" | |
| echo -e "${green_color}Options:${end_color}" | |
| echo -e " -t Specify the type (required). Types are:" | |
| echo -e " ${blue_color}feat${end_color} - A new feature." | |
| echo -e " ${blue_color}fix${end_color} - A bug fix." | |
| echo -e " ${blue_color}config${end_color} - Config." | |
| echo -e " ${blue_color}docs${end_color} - Documentation only changes." | |
| echo -e " ${blue_color}style${end_color} - Changes that do not affect the meaning of the code (white-space, formatting, etc)." | |
| echo -e " ${blue_color}refactor${end_color} - A code change that neither fixes a bug nor adds a feature." | |
| echo -e " ${blue_color}test${end_color} - Adding missing tests or correcting existing ones." | |
| echo -e " ${blue_color}chore${end_color} - Changes to the build process or auxiliary tools and libraries such as documentation generation." | |
| echo -e " ${blue_color}perf${end_color} - A code change that improves performance." | |
| echo -e " ${blue_color}ci${end_color} - Changes to your CI configuration files and scripts." | |
| echo -e " ${blue_color}build${end_color} - Changes that affect the build system or external dependencies (examples: gulp, broccoli, npm)." | |
| echo -e " ${blue_color}temp${end_color} - Temporary commit that won't be included in your CHANGELOG." | |
| echo -e " -s Specify the scope (optional)." | |
| echo -e " -m Specify the commit message (required)." | |
| echo -e " -d Perform a dry run without actual committing." | |
| echo -e " -h Display this help message. \n" | |
| } | |
| # Get options from the command line | |
| while getopts ":t:s:m:dh" flag; do | |
| case "${flag}" in | |
| t) type=${OPTARG} ;; | |
| s) scope=${OPTARG} ;; | |
| m) message=${OPTARG} ;; | |
| d) dry_run=1 ;; | |
| h) show_help; return 0 ;; | |
| \?) echo -e "${red_color}Invalid option: -$OPTARG ${end_color}" >&2; return 1 ;; | |
| esac | |
| done | |
| # Check for required arguments | |
| if [ -z "$type" ] || [ -z "$message" ]; then | |
| show_help | |
| return 1 | |
| fi | |
| # current branch name | |
| local branch_name=$(parse_git_branch) | |
| # avoid commits on the develop branch | |
| if [ "$branch_name" = "develop" ]; then | |
| echo -e "$red_color"Commits to \'develop\' branch are not allowed with this script."$end_color" | |
| return 1 | |
| fi | |
| # check if a branch name is available | |
| if [ -z "$branch_name" ]; then | |
| echo -e "$red_color"Not a Git repository or you are not on any branch."$end_color" | |
| return 1 | |
| fi | |
| # Check if the branch name contains a slash | |
| if [[ "$branch_name" == *"/"* ]]; then | |
| branch_name="${branch_name#*/}" | |
| else | |
| echo "$yellow_color"The branch name does not contain a color. eg: feature/ROB-9999"$end_color" | |
| fi | |
| # Check if the scope is provided to change to (scope) | |
| if [ -n "$scope" ]; then | |
| concat="$type($scope)" | |
| else | |
| concat="$type" | |
| fi | |
| # format the commit message | |
| # c -t "feat" -m "test msg" -s "hmi" | |
| # git commit -m "ROB-1097 feat (hmi): test msg" | |
| local commit_message="$branch_name $concat: $message" | |
| # Dry run logic | |
| if [ $dry_run -eq 1 ]; then | |
| echo -e "${yellow_color}Dry run enabled. The commit command would be:${end_color}" | |
| echo "git commit -m \"$commit_message\"" | |
| else | |
| echo -e "${green_color}GIT MESSAGE | git commit -m \"$commit_message\" | git commit --amend to edit it |${end_color}" | |
| # sudo apt-get install xclip | |
| # Check if xclip is available for copying to clipboard | |
| if command -v xclip >/dev/null 2>&1; then | |
| echo -e "$yellow_color"Copied to clipboard: git commit --amend"$end_color" | |
| echo "git commit --amend" | xclip | |
| else | |
| echo -e "$red_color"Error: xclip is not installed. Cannot copy to clipboard."$end_color" | |
| echo -e "$yellow_color"install xclip: sudo apt-get install xclip"$end_color" | |
| fi | |
| # Uncomment the following line to enable actual committing | |
| git commit -m "$commit_message" | |
| fi | |
| } | |
| # Example usage: | |
| # unpublish_modules -v 1.0.0 -l audiovisual | |
| # unpublish_modules -v 4.4.0 -l system | |
| um() { | |
| local version="" | |
| local lib="" | |
| local auto=false | |
| while getopts "v:l:a" opt; do | |
| case "$opt" in | |
| v) version=$OPTARG ;; | |
| l) lib=$OPTARG ;; | |
| a) auto=true ;; | |
| *) echo "Usage: $0 [-v <version>] [-l <lib>] [-a]" && return 1 ;; | |
| esac | |
| done | |
| if $auto; then | |
| if ! command -v jq >/dev/null 2>&1; then | |
| echo "Error: 'jq' is required but not installed." >&2 | |
| return 1 | |
| fi | |
| if [[ ! -f package.json ]]; then | |
| echo "Error: package.json not found in current directory." >&2 | |
| return 1 | |
| fi | |
| version=$(jq -r '.version' package.json) | |
| name=$(jq -r '.name' package.json) | |
| if [[ -z "$version" || "$version" == "null" || -z "$name" || "$name" == "null" ]]; then | |
| echo "Error: Failed to parse package.json" >&2 | |
| return 1 | |
| fi | |
| case "$name" in | |
| *audiovisual*) lib="audiovisual" ;; | |
| *system*) lib="system" ;; | |
| *common*) lib="common" ;; | |
| *camera*) lib="camera" ;; | |
| *style*) lib="style" ;; | |
| *slp*) lib="slp" ;; | |
| *control*) lib="control" ;; | |
| *proto*) lib="proto" ;; | |
| *localization*) lib="localization" ;; | |
| *) | |
| echo "Error: Could not infer library from package name: $name" >&2 | |
| return 1 | |
| ;; | |
| esac | |
| fi | |
| if [[ -z "$version" || -z "$lib" ]]; then | |
| echo "Error: Both version and library are required." | |
| echo "Usage: $0 [-v <version>] [-l <lib>] [-a]" | |
| return 1 | |
| fi | |
| case "$lib" in | |
| audiovisual) | |
| npm unpublish @forssea_robotics/hmi-module-audiovisual@$version --force --registry http://localhost:4873 | |
| npm unpublish @forssea_robotics/backend-module-audiovisual@$version --force --registry http://localhost:4873 | |
| ;; | |
| system) | |
| npm unpublish @forssea_robotics/hmi-module-system-lib@$version --force --registry http://localhost:4873 | |
| npm unpublish @forssea_robotics/backend-module-system-lib@$version --force --registry http://localhost:4873 | |
| ;; | |
| common) | |
| npm unpublish @forssea_robotics/hmi-module-common@$version --force --registry http://localhost:4873 | |
| npm unpublish @forssea_robotics/shared-module-common@$version --force --registry http://localhost:4873 | |
| npm unpublish @forssea_robotics/backend-module-common@$version --force --registry http://localhost:4873 | |
| ;; | |
| camera) | |
| npm unpublish @forssea_robotics/hmi-module-camera-control@$version --force --registry http://localhost:4873 | |
| npm unpublish @forssea_robotics/backend-module-camera-control@$version --force --registry http://localhost:4873 | |
| ;; | |
| style) | |
| npm unpublish @forssea_robotics/hmi-module-style-lib@$version --force --registry http://localhost:4873 | |
| ;; | |
| slp) | |
| npm unpublish @forssea_robotics/slp-api-nodejs@$version --force --registry http://localhost:4873 | |
| ;; | |
| control) | |
| npm unpublish @forssea_robotics/frs-control-node-addon-lib@$version --force --registry http://localhost:4873 | |
| ;; | |
| proto) | |
| npm unpublish @forssea_robotics/frs-proto-apis@$version --force --registry http://localhost:4873 | |
| ;; | |
| localization) | |
| npm unpublish @forssea_robotics/frs-localization-api-nodejs@$version --force --registry http://localhost:4873 | |
| ;; | |
| *) | |
| echo "Error: Invalid library selected. Use one of: audiovisual, system, common, camera, style, slp, control, localization, proto" | |
| return 1 | |
| ;; | |
| esac | |
| } | |
| boot_slpd(){ | |
| sudo pkill slpd | |
| sudo slpd | |
| } | |
| flag_basic(){ | |
| slptool -s LOCAL -i 127.0.0.1 register product.FORSSEA://127.0.0.1 "(x-serial-number=ROV_GUILLAUME),(x-product-line=rov),(x-product-type=argos),(x-name=argos),(x-hw-revision=v1.1),(x-hw-configuration=basic),(x-sw-version=release/emeraude),(x-sw-iteration=1),(x-sw-description=Nominal release build),(x-sw-date=2024-10-22 15:15:13)" | |
| config=$(slptool -s LOCAL findattrs product.FORSSEA | sort | uniq) | |
| echo "LOCAL SCOPE" | |
| echo "$config" | tr ',' '\n' | |
| } | |
| flag_rovins(){ | |
| slptool -s LOCAL -i 127.0.0.1 register product.FORSSEA://127.0.0.1 "(x-serial-number=ROV_GUILLAUME),(x-product-line=rov),(x-product-type=argos),(x-name=argos),(x-hw-revision=v1.1),(x-hw-configuration=rovins),(x-sw-version=release/emeraude),(x-sw-iteration=1),(x-sw-description=Nominal release build),(x-sw-date=2024-10-22 15:15:13)" | |
| config=$(slptool -s LOCAL findattrs product.FORSSEA | sort | uniq) | |
| echo "LOCAL SCOPE" | |
| echo "$config" | tr ',' '\n' | |
| } | |
| flag_x(){ | |
| slptool -s LOCAL -i 127.0.0.1 register product.FORSSEA://127.0.0.1 "(x-serial-number=ROV_GUILLAUME),(x-product-line=rov),(x-product-type=argos-x),(x-name=argos-raptor),(x-hw-revision=v1.1),(x-hw-configuration=rovins),(x-sw-version=release/emeraude),(x-sw-iteration=1),(x-sw-description=Nominal release build),(x-sw-date=2024-10-22 15:15:13)" | |
| config=$(slptool -s LOCAL findattrs product.FORSSEA | sort | uniq) | |
| echo "LOCAL SCOPE" | |
| echo "$config" | tr ',' '\n' | |
| } | |
| flag_psu(){ | |
| slptool -s NETWORK -i 127.0.0.1 register product.FORSSEA://127.0.0.1 "(x-serial-number=PSU_ROV_GUILLAUME),(x-product-line=PSU),(x-product-type=edge-server),(x-grpc-web-port=5000)" | |
| config=$(slptool -s NETWORK findattrs product.FORSSEA | sort | uniq) | |
| echo "NETWORK SCOPE" | |
| echo "$config" | tr ',' '\n' | |
| } | |
| flag_psu_d() { | |
| slptool -s NETWORK -i 127.0.0.1 deregister product.FORSSEA://127.0.0.1 | |
| } | |
| vpvl_api(){ | |
| source_workspace_vpvl | |
| ros2 run visual_positioning_api api_server_node --ros-args -p address:="0.0.0.0"; | |
| } | |
| vpvl_dataset(){ | |
| source_workspace_vpvl | |
| ros2 launch visual_positioning_nodes visual_odometry.launch.py calibration_file_path:=~/datasets/default_testing_dataset/calib.yaml input_mode:=files; | |
| } | |
| # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. | |
| # [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh | |
| PATH=~/.console-ninja/.bin:$PATH | |
| alias limit='export MAKEFLAGS="-j 4' | |
| # git config --global init.defaultBranch <name> | |
| export PATH=$PATH:/usr/local/bin:/usr/local/cuda/bin | |
| export NVM_DIR="$HOME/.nvm" | |
| [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | |
| [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment