Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
ON/Off power switch






























































































This will be a checklist review of all the connections for the base B3RB
























sudo rm -rf /opt/toolchains
sudo rm -rf /opt/zeth
sudo rm -rf /opt/poetry
rm -rf ~/bin/build_*
rm -rf ~/bin/west
rm -rf ~/bin/cyecca
rm -rf ~/bin/docs
rm -rf ~/cognipilotapt-get remove ros-humble-ros-gzgarden
sudo apt-get install ros-humble-ros-gzharmonic
sudo apt-get install gz-harmonicThis guide provides instructions for connecting the J-Link EDU Mini to the MR-CANHUBK344 with the objective of flashing the Cognipilot software onto the board.













This guide provides instructions for connecting the J-Link EDU Mini to the MR-CANHUBK344 with the objective of flashing the Cognipilot software onto the board
uart:~$
▄▄▄▄▄▄▄▄
▄▄▄▄▄ ▄▄▄▄▄ ▀▀▀▀▀▀▀▀▀
▄███████▀▄██████▄ ▀█████████████████████▀
▄██████████ ████████ ▄ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
███████████▀ ███████▀ ██ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█████████▀ ▀▀▀▀▀▀▀▀ ████ ▀███████████▀
▀█████▀ ▄▄███████████▄ ████ ▄▄▄▄▄▄▄▄▄
▀▀▀ ███████████████▀ ████ ▀▀▀▀▀▀▀▀
▀▀█████▀▀▀▀▀▀ ▀▀▀▀ ▄█████▀
████████▀ ▄▄▄
▀███▀ ▀▀▀
▀▀
╔═══╗╔═══╗╔═══╗╔═╗ ╔╗╔══╗╔═══╗╔══╗╔╗ ╔═══╗╔════╗
║╔═╗║║╔═╗║║╔═╗║║║║ ║║╚╣╠╝║╔═╗║╚╣╠╝║║ ║╔═╗║║╔╗╔╗║
║║ ╚╝║║ ║║║║ ╚╝║║╚╗║║ ║║ ║║ ║║ ║║ ║║ ║║ ║║╚╝║║╚╝
║║ ║║ ║║║║╔═╗║╔╗╚╝║ ║║ ║╚═╝║ ║║ ║║ ║║ ║║ ║║
║║ ╔╗║║ ║║║║╚╗║║║╚╗║║ ║║ ║╔══╝ ║║ ║║ ╔╗║║ ║║ ║║
║╚═╝║║╚═╝║║╚═╝║║║ ║║║╔╣╠╗║║ ╔╣╠╗║╚═╝║║╚═╝║ ╔╝╚╗
╚═══╝╚═══╝╚═══╝╚╝ ╚═╝╚══╝╚╝ ╚══╝╚═══╝╚═══╝ ╚══╝
┏━━━┓┏━━━┓┏━━━┓┏━━━┓┏━━┓ ┏━━━┓┏━━┓
┃┏━┓┃┃┏━━┛┃┏━┓┃┃┏━━┛┃┏┓┃ ┃┏━┓┃┗┫┣┛
┃┃ ┗┛┃┗━┓ ┃┗━┛┃┃┗━┓ ┃┗┛┗┓┃┗━┛┃ ┃┃
┃┃ ┏┓┃┏━┛ ┃┏┓┏┛┃┏━┛ ┃┏━┓┃┃┏┓┏┛ ┃┃
┃┗━┛┃┃┗━━┓┃┃┃┗┓┃┗━━┓┃┗━┛┃┃┃┃┗┓┏┫┣┓
┗━━━┛┗━━━┛┗┛┗━┛┗━━━┛┗━━━┛┗┛┗━┛┗━━┛ros2 launch b3rb_bringup robot.launch.py foxglove:=falseros2 launch b3rb_bringup robot.launch.py














This guide provides instructions for connecting the MCU-Link-MR to the MR-CANHUBK344 with the objective of flashing the Cognipilot software or any other Zephyr based onto the board.


Setting up B3RB with CogniPilot environment software
In this tutorial you will learn how to integrate the BMS772 into the B3RB.
cd ~/cognipilot/ws/cerebri
west update
cd ~/cognipilot/ws/cerebri/app/b3rb
west build -b mr_canhubk3 -p
west flashuart:~$
▄▄▄▄▄▄▄▄
▄▄▄▄▄ ▄▄▄▄▄ ▀▀▀▀▀▀▀▀▀
▄███████▀▄██████▄ ▀█████████████████████▀
▄██████████ ████████ ▄ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
███████████▀ ███████▀ ██ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
█████████▀ ▀▀▀▀▀▀▀▀ ████ ▀███████████▀
▀█████▀ ▄▄███████████▄ ████ ▄▄▄▄▄▄▄▄▄
▀▀▀ ███████████████▀ ████ ▀▀▀▀▀▀▀▀
▀▀█████▀▀▀▀▀▀ ▀▀▀▀ ▄█████▀
████████▀ ▄▄▄
▀███▀ ▀▀▀
▀▀
╔═══╗╔═══╗╔═══╗╔═╗ ╔╗╔══╗╔═══╗╔══╗╔╗ ╔═══╗╔════╗
║╔═╗║║╔═╗║║╔═╗║║║║ ║║╚╣╠╝║╔═╗║╚╣╠╝║║ ║╔═╗║║╔╗╔╗║
║║ ╚╝║║ ║║║║ ╚╝║║╚╗║║ ║║ ║║ ║║ ║║ ║║ ║║ ║║╚╝║║╚╝
║║ ║║ ║║║║╔═╗║╔╗╚╝║ ║║ ║╚═╝║ ║║ ║║ ║║ ║║ ║║
║║ ╔╗║║ ║║║║╚╗║║║╚╗║║ ║║ ║╔══╝ ║║ ║║ ╔╗║║ ║║ ║║
║╚═╝║║╚═╝║║╚═╝║║║ ║║║╔╣╠╗║║ ╔╣╠╗║╚═╝║║╚═╝║ ╔╝╚╗
╚═══╝╚═══╝╚═══╝╚╝ ╚═╝╚══╝╚╝ ╚══╝╚═══╝╚═══╝ ╚══╝
┏━━━┓┏━━━┓┏━━━┓┏━━━┓┏━━┓ ┏━━━┓┏━━┓
┃┏━┓┃┃┏━━┛┃┏━┓┃┃┏━━┛┃┏┓┃ ┃┏━┓┃┗┫┣┛
┃┃ ┗┛┃┗━┓ ┃┗━┛┃┃┗━┓ ┃┗┛┗┓┃┗━┛┃ ┃┃
┃┃ ┏┓┃┏━┛ ┃┏┓┏┛┃┏━┛ ┃┏━┓┃┃┏┓┏┛ ┃┃
┃┗━┛┃┃┗━━┓┃┃┃┗┓┃┗━━┓┃┗━┛┃┃┃┃┗┓┏┫┣┓
┗━━━┛┗━━━┛┗┛┗━┛┗━━━┛┗━━━┛┗┛┗━┛┗━━┛ros2 launch b3rb_bringup robot.launch.py







nsh> bms set can-mode cyphal
nsh> bms set cyphal-node-static-id 100
nsh> bms save
nsh> rebootmkdir -p ~/.cyphal
wget https://github.com/OpenCyphal/public_regulated_data_types/archive/refs/heads/master.zip -O dsdl.zip
unzip dsdl.zip -d ~/.cyphal
mv -f ~/.cyphal/public_regulated_data_types*/* ~/.cyphalexport UAVCAN__NODE__ID=42
export UAVCAN__CAN__IFACE=socketcan:can0
export UAVCAN__CAN__MTU=8
export CYPHAL_PATH=/home/user/.cyphal# yakut sub --with-metadata port:type
# Run the following commands in separate terminals
yakut sub --with-metadata 4096:reg.udral.physics.electricity.sourcets
yakut sub --with-metadata 4097:reg.udral.service.battery.status
yakut sub --with-metadata 4098:reg.udral.service.battery.parameters git clone git@github.com:mounalbaccouch-nxp/BMS_cyphalcan.gitcd BMS_cyphalcan
python3.10 cyphal_bms_print_status.pygit clone git@github.com:mounalbaccouch-nxp/BMS_cyphalcan.gitcd BMS_cyphalcan
python3.10 cyphal_bms_ros2-pub_status.pyros2 topic echo /battery_stateThis page describes the integration of PMD Flexx2 ToF camera with NavQPlus







$ unzip ~/libroyale-<ROYALE-SDK-VERSION>-LINUX-x86-64Bit.zip
$ cd ~/libroyale-<ROYALE-SDK-VERSION>-LINUX-x86-64Bit/
$ sudo cp driver/udev/10-royale-ubuntu.rules /etc/udev/rules.d/
$ sudo udevadm control --reload-rules && sudo udevadm trigger (or reboot)
$ cd ~/libroyale-<ROYALE-SDK-VERSION>-LINUX-x86-64Bit/bin
$ ./royaleviewer$ unzip ~/libroyale-4.24.0.1201-LINUX-arm-64Bit-ub2004.zip
$ cd ~/libroyale-4.24.0.1201-LINUX-arm-64Bit/
$ sudo cp driver/udev/10-royale-ubuntu.rules /etc/udev/rules.d/
$ sudo udevadm control --reload-rules && sudo udevadm trigger (or reboot)$ cd ~/libroyale-4.24.0.1201-LINUX-arm-64Bit/bin
$ ./tcpserver$ mkdir -p ws_tof/src
$ cp -rf ~/libroyale-4.24.0.1201-LINUX-arm-64Bit/samples/cpp/sampleROS2 ~/ws_tof/src$ colcon build --cmake-args "-DCMAKE_PREFIX_PATH=~/libroyale-4.24.0.1201-LINUX-arm-64Bit/share"$ source install/setup.bash
$ ros2 run royale_in_ros2 royale_in_ros2



cd ~
west init -m "https://github.com/NXPHoverGames/zephyr.git" cliff_detection_project
cd ~/cliff_detection_project
west updatecd ~/cliff_detection_project/zephyr
git checkout tof_vl53l4cd_with_mux_pr
west build -b mr_canhubk3 samples/sensor/vl53l4cd -p
west flashsudo chmod 666 /dev/ttyUSBn
cu -l /dev/ttyUSBn -s 115200proximity = 1
distance = 0.019 m
proximity = 1
distance = 0.021 m
proximity = 1
distance = 0.019 m
proximity = 1
distance = 0.018 m
proximity = 1
distance = 0.020 m
proximity = 1
distance = 0.017 m
proximity = 1
distance = 0.018 m
proximity = 1
distance = 0.019 m
proximity = 1
distance = 0.020 m
proximity = 1
distance = 0.018 m
proximity = 1
distance = 0.020 m
proximity = 1
distance = 0.018 m
proximity = 1
distance = 0.020 m
proximity = 1
distance = 0.020 m
proximity = 1
distance = 0.019 m
proximity = 1
distance = 0.016 mros2 launch b3rb_gz_bringup sil.launch.pyros2 launch electrode electrode.launch.py sim:=true#!/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/dream_world"]="https://github.com/NXPHoverGames/dream_world"
["cranium/src/b3rb_simulator"]="https://github.com/NXPHoverGames/b3rb_simulator"
["electrode/src/electrode"]="https://github.com/NXPHoverGames/electrode"
["ws/cerebri"]="https://github.com/NXPHoverGames/cerebri"
["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_native.sh
./update_repos_native.shcd ~/cognipilot/cranium/
colcon build --symlink-install
cd ~/cognipilot/cranium/
source install/setup.bashcd ~/cognipilot/electrode/
colcon build --symlink-install
cd ~/cognipilot/electrode/
source install/setup.bashcd ~/cognipilot/ws/cerebri
west update
west build -b native_sim app/b3rb/ -p -t install
source ~/.bashrcros2 launch b3rb_gz_bringup sil.launch.py world:=nxp_raceway_octagonros2 launch electrode electrode.launch.py sim:=true 















sudo curl -fsSL https://raw.githubusercontent.com/cntools/libsurvive/master/useful_files/81-vive.rules \
-o /etc/udev/rules.d/81-vive.rules
sudo udevadm control --reload-rules && sudo udevadm triggersudo apt-get install build-essential \
cmake \
freeglut3-dev \
libatlas-base-dev \
liblapacke-dev \
libopenblas-dev \
libpcap-dev \
libusb-1.0-0-dev \
libx11-dev \
zlib1g-devmkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
git clone https://github.com/asymingt/libsurvive_ros2.git
cd ..
colcon build
source install/setup.bashros2 launch libsurvive_ros2 libsurvive_ros2.launch.py rosbridge:=true
Cognipilot MR-B3RB Robot installation specific instructions for nxp-cup









CONFIG_CEREBRI_SENSE_UBX_GNSS_MODULE_TYPE_M8=y
CONFIG_CEREBRI_SENSE_UBX_GNSS_BAUD=38400CONFIG_CEREBRI_SENSE_POWER=ncd ~/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.pysudo apt updatesudo apt install ros-humble-camera-calibration-parserssudo apt install ros-humble-camera-info-managersudo apt install ros-humble-launch-testing-ament-cmakecd ~/cognipilot/cranium/srcgit clone https://github.com/NXPHoverGames/b3rb_camera_calibrationcd ~/cognipilot/cranium/colcon build --symlink-install --packages-select b3rb_camera_calibrationsource ~/cognipilot/cranium/install/setup.shros2 launch b3rb_camera_calibration b3rb_camera_calibration_launch.py ros2 run b3rb_camera_calibration cameracalibrator --size 9x6 --square 0.02 --ros-args -r image:=/camera/image_raw -p camera:='chessboard'ros2 launch electrode electode.launch.pyros2 topic pub /calibration_control std_msgs/msg/String "data: 'start_calibration'" --onceros2 topic pub /calibration_control std_msgs/msg/String "data: 'save_results'" --oncecd ~/cognipilotmkdir calibration_datatar -xzvf calibrationdata.tar.gz -C calibration_data/std_msgs/Header header
# Vector 0 head and tail points
uint32 m0_x0 # Tail of vector @ x
uint32 m0_y0 # Tail of vector @ y
uint32 m0_x1 # Head of vector @ x
uint32 m0_y1 # Head of vector @ y
# Vector 1 head and tail points
uint32 m1_x0 # Tail of vector @ x
uint32 m1_y0 # Tail of vector @ y
uint32 m1_x1 # Head of vector @ x
uint32 m1_y1 # Head of vector @ yros2 launch electrode electrode.launch.py #sim:=true (If you are using simulation)// Follow line function in velocity.c
static void follow_line(context* ctx)
{
double frame_width = 78;
double frame_height = 51;
double window_center = frame_width / 2;
double linear_velocity=0.7;
double angular_velocity=-0.6;
double single_line_steer_scale=0.6;
double x = 0.0;
double y = 0.0;
double steer = 0.0;
double speed = 0.0;
int num_vectors = 0;
if(!(ctx->pixy_vector.m0_x0 == 0 && ctx->pixy_vector.m0_x1 == 0 && ctx->pixy_vector.m0_y0 == 0 && ctx->pixy_vector.m0_y1 == 0)) {
num_vectors++;
}
if(!(ctx->pixy_vector.m1_x0 == 0 && ctx->pixy_vector.m1_x1 == 0 && ctx->pixy_vector.m1_y0 == 0 && ctx->pixy_vector.m1_y1 == 0)) {
num_vectors++;
}
switch(num_vectors) {
case 0:
speed = 0.0;
steer = 0.0;
break;
case 1:
if(ctx->pixy_vector.m0_x1 > ctx->pixy_vector.m0_x0) {
x = (ctx->pixy_vector.m0_x1 - ctx->pixy_vector.m0_x0) / frame_width;
y = (ctx->pixy_vector.m0_y1 - ctx->pixy_vector.m0_y0) / frame_height;
} else {
x = (ctx->pixy_vector.m0_x0 - ctx->pixy_vector.m0_x1) / frame_width;
y = (ctx->pixy_vector.m0_y0 - ctx->pixy_vector.m0_y1) / frame_height;
}
if((ctx->pixy_vector.m0_x0 != ctx->pixy_vector.m0_x1) && ((y > 0.0) || (y <0.0))) {
steer = -angular_velocity * (x / y) * single_line_steer_scale;
} else {
steer = 0.0;
}
speed = linear_velocity;
break;
case 2:
if((ctx->pixy_vector.m1_x0 >= ctx->pixy_vector.m1_x1) && (ctx->pixy_vector.m0_x0 <= ctx->pixy_vector.m0_x1)){
steer = angular_velocity * (((ctx->pixy_vector.m0_x1 + ctx->pixy_vector.m1_x1) / 2.0) - window_center) / frame_width;
}else if ((ctx->pixy_vector.m1_x0 < ctx->pixy_vector.m1_x1) && (ctx->pixy_vector.m0_x0 <= ctx->pixy_vector.m0_x1)){
steer = angular_velocity * (((ctx->pixy_vector.m0_x1 + ctx->pixy_vector.m1_x0) / 2.0) - window_center) / frame_width;
}else if ((ctx->pixy_vector.m1_x0 > ctx->pixy_vector.m1_x1) && (ctx->pixy_vector.m0_x0 > ctx->pixy_vector.m0_x1)){
steer = angular_velocity * (((ctx->pixy_vector.m0_x0 + ctx->pixy_vector.m1_x1) / 2.0) - window_center) / frame_width;
}else {
steer = angular_velocity * (((ctx->pixy_vector.m0_x0 + ctx->pixy_vector.m1_x0) / 2.0) - window_center) / frame_width;
}
speed = linear_velocity;
break;
}
double vel_linear_x = speed * (1 - fabs(2 * steer));
double turn_angle = 0;
double omega_fwd = 0;
double V = vel_linear_x;
double omega = steer;
double delta = 0;
CASADI_FUNC_ARGS(ackermann_steering);
args[0] = &ctx->wheel_base;
args[1] = ω
args[2] = &V;
res[0] = δ
CASADI_FUNC_CALL(ackermann_steering);
omega_fwd = V / ctx->wheel_radius;
if (fabs(V) > 0.01) {
turn_angle = delta;
}
b3rb_set_actuators(&ctx->actuators, turn_angle, omega_fwd);
}cd ~/cognipilot/ws/cerebri
west update
west build -b native_sim app/b3rb/ -p -t installcd ~/cognipilot/ws/cerebri
west update
west build -b mr_canhubk3 app/b3rb -p
west flashdef statusCallback(self,data):
#Putting robot in AUTO mode
if(data.mode!=2):
joystick_msg=sensor_msgs.msg.Joy()
joystick_msg.header.stamp=ROSClock().now().to_msg()
joystick_msg.axes=[0.0,0.0,0.0,0.0]
joystick_msg.buttons = [0, 1, 0, 0, 0, 0, 0, 0]
#self.JoystickPub.publish(joystick_msg)
#If robot is in AUTO mode -> arming the robot
elif(data.mode==2 and data.arming!=2):
joystick_msg=sensor_msgs.msg.Joy()
joystick_msg.header.stamp=ROSClock().now().to_msg()
joystick_msg.axes=[0.0,0.0,0.0,0.0]
joystick_msg.buttons = [0, 0, 0, 0, 0, 0, 0, 1]
#self.JoystickPub.publish(joystick_msg)sleep(15.0)


import numpy as np
def create_sound(tone_name, freq_max, freq_min, duration_sec, num_phases, steps):
print('struct tones_t {:s}[] = {{'.format(tone_name))
amp = (freq_max-freq_min)/2
for i in np.linspace(0, duration_sec, num=steps, endpoint=True):
note = freq_min+amp*(1+np.sin(np.pi*(num_phases/duration_sec)*i))
note_str = ' {{ .note = {:d}, .duration = {:d} }},'.format(int(note), int((duration_sec/steps)*1000))
print(note_str)
print(' { .note = REST, .duration = whole },')
print('};')
create_sound('b3rb_reject_tone', 2500, 150, .75, 2.5, 60)struct tones_t b3rb_reject_tone[] = {
{ .note = 110, .duration = half },
{ .note = REST, .duration = thrirtysecond },





cd ~/cognipilot/cranium/
vcs pull
colcon build --symlink-installcd ~/cognipilot/ws/cerebri
git pull
west build -b mr_canhubk3 app/b3rb -p
west flash


CONFIG_CEREBRI_SENSE_SAFETY=n
cd ~/cognipilot/ws/cerebri
west update
cd ~/cognipilot/ws/cerebri/app/b3rb
west build -b mr_canhubk3 -p
west flash
cd ~/cognipilot/ws/cerebri
west update
cd ~/cognipilot/ws/cerebri/app/b3rb
west build -b mr_canhubk3 -p
west flash

































































