Skip to content

Install

Serkan Mazlum edited this page Aug 11, 2024 · 4 revisions

These steps are valid for the main branch. In older branches (version 1.0 and earlier), the build process is different; in older versions, the build process proceeds entirely through steps that the user performs manually. With the newly added Makefile files, the process can now proceed directly with the make command.

Downloading the packages

  • The repository and submodules on GitHub are downloaded.
git clone git@github.com:serkanMzlm/Vehicle-Control-Sotfware.git
cd Vehicle-Control-Sotfware
git submodule  init
git submodule update

# Or

git clone git@github.com:serkanMzlm/Vehicle-Control-Sotfware.git --recursive

Compile

  • To ensure the project functions correctly, the packages within src/drivers need to be compiled and included in the system.
  • To enable Gazebo Garden to find the models correctly, the project model path should be added to the GZ_SIM_RESOURCE_PATH environment variable. In Gazebo, any change made to the world environment directly affects the system; there is no need to rebuild anything.
  • The purpose of the code specified in the drive_launch.py file is to parse the data in GZ_SIM_RESOURCE_PATH to determine the environment in which the simulation will run and to locate the models. Therefore, ensure that 'GZ_SIM_RESOURCE_PATH' is correctly assigned.
if gz_sim_resource_path:
    paths = gz_sim_resource_path.split(":")
    desired_path = None

    for path in paths:
        if "Vehicle-Control-Sotfware" in path:
            desired_path = path
            break
    
    if desired_path:
        directory = desired_path.split("/")
        sim_world_path = "/".join(directory[:-1])
        sim_world_file = simulation_world_path = Path(sim_world_path, "worlds", "land_vehicle.sdf")
        simulation = ExecuteProcess(cmd=["gz", "sim", "-r", sim_world_file])
    else:
        print("Vehicle-Control-Sotfware directory not found in GZ_SIM_RESOURCE_PATH.")
        simulation = ExecuteProcess(cmd=["gz", "sim"])
  • To locate the library paths, the VEHICLE_CONTROL_SOFTWARE environment variable needs to be added to the system.
  • In older versions, these variables needed to be set manually. In the new version, the make command automatically handles everything that needs to be done.
cd Vehicle-Control-Sotfware

# The make command sets the environment variables, writes them to the  
# .bashrc file, and ensures the necessary libraries are compiled.
make
  • By examining the Makefile, you can learn about the available targets.

  • You can build ROS2 packages using colcon build --packages-select [pkc_name]. Alternatively, you can use make to build the packages listed in the packages.txt file.

colcon build --packages-select  camera_calibration

# Or

make ros_build
  • The make ros_build command builds the packages specified in the packages.txt file. After all the build processes are complete, it pauses at the message Press Enter to continue and waits for you to review the outputs. When Enter is pressed, it displays information on which packages were successful and which failed.

image

  • If you do not want some of the packages listed in the packages.txt file to be built, either remove the name of the package you do not want or prefix the package name with *. This will cause the system to skip that package during the build process. For example, *save_image. You can add your custom packages here to ensure they are built.

Remove

# Ensures that only library files are deleted.
make clean

# Ensures the deletion of directories created during the ROS2 build process
make ros_clean

# Ensures that the ros_clean and clean commands run simultaneously
make all_clean

Clone this wiki locally