Cognipilot MR-B3RB Robot installation specific instructions for nxp-cup
To follow this tutorial you first need to follow and install everything explained in: CogniPilot developer guide on MR-B3RB
You must also follow the NXP-CUP 2024: Simulation Install instructions as it is explained how to update you development computer for the NXP-CUP 2024.
If you have correctly followed the previous steps, you should already be familiar with how to flash the Cognipilot software onto the MR-CANHUBK344 board. In this step, we will flash the board again, but this time with an updated version of the Cerebri software that includes support for the NXP Cup 2024. Additionally, we will need to log in via SSH to the NavQPlus and update the cranium workspace to enable support for the NXP Cup, similar to the procedure outlined on the previous page.
In your development computer go to:
Check that you are on the nxp-cup branch
Which should return:
If it doesn't show that:
Remember if you PDB does not have the battery sensor you have to follow this guide: Configuring Cerebri Software for MR-CANHUBK344 Without Power Measurement Capability
If you have ensured that you are on the nxp-cup branch and that there is not any update available. Then type the following command:
west
west
to MR CANHUBK3Make sure Segger JLink is on your system and the MR CANHUBK3 is connected to the JLink programmer: Connect J-Link EDU Mini to MR-CANHUBK344 with DCD-LZ adapt board.
Once it has finished, you can disconnect the J-Link from your computer and from the MR-CANHUBK344.
In case the west flash command failed, put the followung commands on the terminal:
If you have any doubt or problem in this section please first refer to this documentation: https://airy.cognipilot.org/cranium/compute/navqplus/setup/
Once you have flashed the MR-CANHUBK344, It's time to log into the NavQPlus. Do this with this command:
Next, we will install the packages to develop the algorithm for the NXP CUP 2024 in the B3RB robot.
To simplify repository updates, we've created a shell script. This script automates the process of updating all repositories to the latest versions hosted on the NXPHoverGames GitHub, specifically for the NXP Cup.
The changes on the repositories are:
Synapse Protobuf and Synapse Tinyframe: Define the Pixy Vector message in the Protobuf language and provide essential definitions and functions for the TinyFrame library to operate correctly. For more information, refer to the Synapse documentation.
Synapse msgs and Synapse ros: Extend ROS with the Pixy Vector message definition and support Synapse which the facilitates communication between NavQPlus (ROS2) and CANHUBK344 (Zephyr).
B3RB robot: Includes the launch file for the node that processes the race track images.
NXP CUP Vision: Added ROS2 package for processing race track images, transforming perspectives, detecting track edges, and publishing both the debug image and the Pixy Vector, pivotal for visual processing.
This file ensures that all the repositories are updated. Save this script in ~/cognipilot:
Save this script as update_repos_navqplus.sh in the ~/cognipilot
directory, using any text editor of your choice, such as Vim or nano.
Then, open the terminal and execute the following commands:
Change directory to ~/cognipilot
and make the script executable:
This must have updated all your repositories. Please review the output of this script. It's possible that you have made local changes to the repositories, and you may need to stash them.
To build the software, navigate to the cranium/src
directory within ~/cognipilot
:
Now, you are ready to operate the platform.
On the NavQPlus, run the B3RB launch file:
Start Foxglove for operation and data visualization run the following command in your development computersimulation, run:
These commands will initiate the algorithm on the MR-B3RB robot and Foxglove viewer. You should locate your robot in the racetrack.
To initiate the robot's movement, press the AUTO button and the arm button on the joystick. This action will activate the robot's line-following mode and set it to the armed state, preparing it for operation.
Once the AUTO and arm buttons on the joystick are pressed, the robot should immediately begin to navigate around the racetrack. To understand the underlying code and setup, and to explore ways to obtain a better performance for the NXP CUP 2024, proceed to the next tutorial.