Week 10 :

Updating agl-ros2-ydlidar feature to add SDK support

  • Update agl-ros2-ydlidar feature template with qt5-toolchain packagegroup (packagegroup-qt5-toolchain-target).

    # Change into AGL feature directory
    $ cd $AGL_TOP/master/meta-agl/templates/feature/agl-ros2-ydlidar/
    
    # Edit CONF file
    $ vim 50_local.conf.inc
    
      #meta-ros2-ydlidar                
    
      IMAGE_INSTALL_append = " packagegroup-agl-ros2-ydlidar"
      IMAGE_INSTALL_append = " packagegroup-agl-appfw-native-qt5"
      IMAGE_INSTALL_append = " packagegroup-qt5-toolchain-target"
    

Build SDK for master/x86: meta-ros + agl-image-weston + YDLIDAR + qt support using updated agl-ros2-ydlidar feature

  • Kindly go through setting up AGL SDK for detailed reference to setup and initialize AGL SDK.

    # Clone the meta-ros layer, skip if already cloned
    $ cd $AGL_TOP/master/external
    $ git clone https://github.com/ros/meta-ros.git
    $ cd meta-ros
    $ git checkout -b dunfell
    
    # Setup build directory
    $ cd $AGL_TOP/master/
    $ source meta-agl/scripts/aglsetup.sh -b new-build-x86-meta-ros-weston-agl-ros2-ydlidar-qt agl-demo agl-devel agl-ros2-ydlidar
    $ ln -sf $AGL_TOP/site.conf conf/
    $ ls -alh conf/
    
    # Edit the following conf files :
    
    $ vim conf/local.conf #add the following to the bottom, to save error logs for future debugging
    # local.conf
      INHERIT += "buildhistory"
      BUILDHISTORY_COMMIT = "1"
    
    # Build the image
    
    $ cd $AGL_TOP/master/new-build-x86-meta-ros-weston-agl-ros2-ydlidar-qt/
    $ source agl-init-build-env #if not sourced
    $ bitbake -p ros-core #build ros-core first, to check all layers are added.
    $ time bitbake -c populate_sdk agl-image-weston #wait for the build process to finish.
    

Setup SDK for master/x86 on dev system: meta-ros + agl-image-weston + YDLIDAR + qt support using updated agl-ros2-ydlidar feature

  • Download poky-agl-glibc-agl-image-weston-qemux86-64-toolchain prebuilt sdk x86_64 to help quickstart the service and application development process.

    # agl sdk x86-64 : https://drive.google.com/drive/folders/13EGSqkBFMEpQWZJY7eMPjbvyt40Pwqtr?usp=sharing
    
    # Create application developmment directory and copy SDK into them
    $ mkdir ~/Documents/agl-app
    $ cp ~/Downloads/poky-agl-glibc-x86_64-agl-image-weston-corei7-64-qemux86-64-toolchain-11.91.0+snapshot.sh ~/Documents/agl-app/
    $ cd ~/Documents/agl-app
    
    # Install the downloaded SDK
    $ chmod +x poky-agl-glibc-x86_64-agl-image-weston-corei7-64-qemux86-64-toolchain-11.91.0+snapshot.sh 
    $ mkdir agl-sdk-custom-image/
    $ ./poky-agl-glibc-x86_64-agl-image-weston-corei7-64-qemux86-64-toolchain-11.91.0+snapshot.sh 
      # Select target directory for SDK : ~/Documents/agl-app/agl-sdk-custom-image/
          
      Automotive Grade Linux SDK installer version 11.91.0+snapshot
      =============================================================
      Enter target directory for SDK (default: /opt/agl-sdk/11.91.0+snapshot-corei7-64): ~/Documents/agl-app/agl-sdk-custom-image
      You are about to install the SDK to "/home/boron/Documents/agl-app/agl-sdk-custom-image". Proceed [Y/n]? Y
      Extracting SDK......................................................................................................................done
      Setting it up...done
      SDK has been successfully set up and is ready to be used.
      Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.
      $ . /home/boron/Documents/agl-app/agl-sdk-custom-image/environment-setup-corei7-64-agl-linux
    
    # Source the SDK environment setup, each time you wish to use the SDK in a new shell session
    $ source ~/Documents/agl-app/agl-sdk-custom-image/environment-setup-corei7-64-agl-linux
    

Gerrit change request for the work done

  • agl-ros2 : Enables building of meta-ros2-foxy layer with additional support for YDLIDAR drivers.

  • Change Request #26559 : Added support for ros2 in AGL and ydlidar driver support by creation of recipes for ydlidar driver and sdk and packagegroup-agl-ros2-minimal & packagegroup-agl-ros2-ydlidar. Concurrently, created a feature template to allow for BBLAYERS and local conf dependencies.

    meta-agl-devel
    │
    ├── meta-agl-devel.md #documentation
    ├── meta-agl-ros2
    │   ├── conf
    │   │   └── layer.conf
    │   ├── recipes-platform
    │   │   └── packagegroups
    │   │       ├── packagegroup-agl-ros2-minimal.bb #minimal set of packages required to ROS2
    │   │       └── packagegroup-agl-ros2-ydlidar.bb #support of ydlidar with ROS2
    │   └── recipes-ros2
    │       ├── ydlidar-ros2-driver
    │       │   └── ydlidar-ros2-driver_1.0.1.bb #YDLIDAR driver recipe for ROS2 support
    │       └── ydlidar-ros2-sdk
    │           └── ydlidar-ros2-sdk_1.4.7.bb #dependency for ydlidar_ros2_driver.
    └── templates
        └── feature
            └── agl-ros2
               ├── 50_bblayers.conf.inc #layer dependencies for meta-ros2
               ├── 50_local.conf.inc #contains config for IMAGE_INSTALL_append
               └── README_feature_agl-ros2.md #documentation