Execute AIM 2024 (Automation Setup)
Last updated
Last updated
Download the following package:
Extract this package at location: ~/cognipilot/cranium/. After extraction your directories should look like the following:
This launcher will take care of the following steps to execute the AIM 2024 simulation setup:
Preparation for clean build: deleting previous build's log, build and install folders
Clean Build: colcon build
Sourcing the setup.bash: source ~/cognipilot/cranium/install/setup.bash
Updating the Raceway_1.sdf world file to include the obstacles, before the build
Launching the simulation: ros2 launch b3rb_gz_bringup sil.launch.py world:=Raceway_1
Auto firing of command: ros2 run b3rb_ros_line_follower vectors
Auto firing of command: ros2 run b3rb_ros_line_follower detect
Auto firing of command: ros2 run b3rb_ros_line_follower runner
This launcher will do all the pre-requiste manual work to run the buggy in the simulation by default i.e. user doesn't need to manually run above said commands.
The launcher will automatically always clean build the setup before execution, i.e. all changes will be automatically included. No need to separately run build/update commands.
To add/remove the obstacle and track models in simulation, using this launcher one doesn't need to manually update the Raceway_1.sdf world file present at ~/cognipilot/cranium/src/dream_world/worlds. To add obstacles using the launcher, one need to open and edit the models_config.json file present inside the launcher directory (~/cognipilot/cranium/AIM_2024_launcher), in the following manner:
Please make sure to save the file before running the launch command and follow proper JSON syntax in the file
"embed_model_1": It is a custom unique identifier given to each entity which allows Gazebo to keep track of each model spawned into the simulation.
Use unique string values for the "embed_model_1" key for each obstacle to be added. As same value will not spawn the obstacles into simulation
"pose": This parameter defines the position and orientation of models in simulation. rIt is represented by "x y z R P Y" where: x is x-coordinate, y is y-coordinate, z is z-coordinate, R is roll, P is pitch and Y is yaw.
"type": This tag will contain name/type of the model to be spawned into the simulation. This represents the name of the desired model that has to be spawned and is stored either in ~/cognipilot/cranium/src/dream_world/models* .
Please make sure the name of the model passed to the "type" parameter must be case sensitive as well as present in the mentioned folder.
Please make sure to save the file before running the launch command and follow proper JSON syntax in the file
To execute the launcher, open a new terminal in directory: ~/cognipilot/cranium/AIM_2024_launcher.
There are two modes of executing the launcher: start and stop
This mode will do the following steps in mentioned order: - Close the previous running simulation instance - Update the world file in dream_worlds folder - Perform clean build of stack - Sourcing of bash file - Launch the simulation - Execute commands to make buggy move autonomously in simulation
This will automatically include all the changes done by user in b3rb_ros_line_follower module/folder.
To execute the launcher in start mode, run the following command on terminal:
On executing the above command you will get output similar to:
This mode will only close the running simulation instance
To execute the launcher in stop mode, run the following command on terminal:
On executing the above command you will get output similar to below image and simulation instance will terminate, killing all background process needed by simulation to run and communication between ros2 and gazebo: