Cognipilot MR-B3RB Robot installation specific instructions for nxp-cup
cd ~/cognipilot/ws/cerebri
git pullcd ~/cognipilot/ws/cerebri
git statusOn branch nxp-cup
Your branch is up to date with 'origin/nxp-cup'.
nothing to commit, working tree cleangit checkout nxp-cupcd ~/cognipilot/ws/cerebri
west updatecd ~/cognipilot/ws/cerebri
west build -b mr_canhubk3 app/b3rb -pcd ~/cognipilot/ws/cerebri
west flashJLinkExe
connect
S32K344
S
4000
loadbin /home/$user/cognipilot/ws/cerebri/build/zephyr/zephyr.elf 0x400000
exitssh <username>@<hostname>.local#!/bin/bash
declare -A repos=(
["cranium/src/synapse_protobuf"]="https://github.com/NXPHoverGames/synapse_protobuf"
["cranium/src/synapse_tinyframe"]="https://github.com/NXPHoverGames/synapse_tinyframe"
["cranium/src/synapse_msgs"]="https://github.com/NXPHoverGames/synapse_msgs"
["cranium/src/synapse_ros"]="https://github.com/NXPHoverGames/synapse_ros"
["cranium/src/b3rb_robot"]="https://github.com/NXPHoverGames/b3rb_robot"
["cranium/src/nxp_cup_vision"]="https://github.com/NXPHoverGames/nxp_cup_vision"
)
# Update existing repositories or clone if they don't exist
for repo in "${!repos[@]}"; do
echo "Processing $repo..."
repo_path="${repo}" # Derive the full path
# Check if the repository directory exists. If it does not, clone it.
if [ ! -d "${repo_path}" ]; then
echo "Repository ${repo_path} does not exist. Cloning..."
git clone --branch nxp-cup "${repos[$repo]}" "${repo_path}"
echo "Cloned ${repo} into ${repo_path}."
fi
# Navigate to the repository directory
cd "${repo_path}" || { echo "Failed to change directory to ${repo_path}. Does it exist?"; continue; }
# Set the new remote URL
git remote set-url origin "${repos[$repo]}"
echo "Remote changed to ${repos[$repo]}"
# Fetch changes from the new remote
git fetch origin
echo "Fetched changes from origin."
# Checkout the specific branch
git checkout nxp-cup
if [ $? -eq 0 ]; then
echo "Checked out nxp-cup branch."
# Pull the latest changes from the branch
git pull origin nxp-cup
echo "Pulled latest changes from nxp-cup branch."
else
echo "Failed to checkout nxp-cup branch. Does it exist?"
fi
# Return to the original directory
cd - > /dev/null
donecd ~/cognipilot
chmod +x update_repos_navqplus.sh
./update_repos_navqplus.shcd ~/cognipilot/cranium/
colcon build --symlink-install
cd ~/cognipilot/cranium/
source install/setup.bashros2 launch b3rb_bringup robot.launch.pyros2 launch electrode electrode.launch.py
