Week 3 :

Build master/raspberrypi4: meta-ros + agl-demo-platform

  • Kindly go through build process of AGL and building for raspberrypi4 for detailed reference to setup and initialize AGL workspace.

    # After setting up AGL workspace
    
    # 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 -f -m raspberrypi4 -b build-rpi4-ros-demo agl-demo agl-devel
    $ 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"
      IMAGE_INSTALL_append = " packagegroup-ros-world-foxy"
      ROS_SUPERFLORE_GENERATED_WORLD_PACKAGES_remove = "plotjuggler"
      ROS_SUPERFLORE_GENERATED_WORLD_PACKAGES_remove = "plotjuggler-msgs"
      ROS_SUPERFLORE_GENERATED_WORLD_PACKAGES_remove = "plotjuggler-ros"
      ROS_SUPERFLORE_GENERATED_WORLD_PACKAGES_remove = "eigenpy"
      ROS_SUPERFLORE_GENERATED_WORLD_PACKAGES_remove = "py-trees-ros-tutorials"
    
    $ vim conf/bblayers.conf #Replace the following chunk
    # bblayers.conf
      AGL_META_NETWORKING ?= ""
      AGL_META_PYTHON = "${METADIR}/external/meta-openembedded/meta-python"
      AGL_META_ROS = " \
        ${METADIR}/external/meta-ros/meta-ros-common \
        ${METADIR}/external/meta-ros/meta-ros-backports-gatesgarth \
        ${METADIR}/external/meta-ros/meta-ros2 \
        ${METADIR}/external/meta-ros/meta-ros2-foxy \
        "
      AGL_OTHER_DEPENDENCY_LAYERS = " \
        ${AGL_META_NETWORKING} \
        ${AGL_META_PYTHON} \
        ${AGL_META_ROS} \
        "
      
    $ vim ../meta-agl-demo/recipes-platform/images/agl-demo-platform.bb
    
        # comment out distro-build-manifest
        # distro-build-manifest \
        #
    
    # Build the image
      
    $ cd $AGL_TOP/master/build-rpi4-ros-demo/
    $ source agl-init-build-env #if not sourced
    $ bitbake -p ros-core #build ros-core first, to check all layers are added.
    $ time bitbake agl-demo-platform #wait for the build process to finish.
    
  • Primary branch of google-benchmark present in the meta-ros2 layer was renamed from master to main which led to failing builds, corresponding pull-request 858 was requested and correspondingly merged into the meta-ros repository to rectify the issue.

Run master/raspberrypi4: meta-ros + agl-demo-platform

  • Kindly use pre-built image agl-demo-platform-raspberrypi4-64, if you want to skip the building process.

  • Kindly go through using prebuilt raspberrypi4 images for detailed reference to setup and initialize AGL workspace.

    ## gdrive : https://drive.google.com/drive/folders/1qZ7gjSbMCgE6Qez41LteeLgz4Na097-7?usp=sharing
    
    # Copy image and extract into SD card
    $ cp ~/Downloads/agl-demo-platform-raspberrypi4-64.wic.xz ./
    $ lsblk #find <SD_CARD>
    $ sudo umount <SD_CARD>
    $ xzcat agl-demo-platform-raspberrypi4-64.wic.xz | sudo dd of=<SD_CARD> bs=4M
    $ sync
      
    # Boot up Pi : Black Screen Error at this moment.
    

Build master/x86: meta-ros + agl-image-weston

  • Kindly go through build process of AGL and building for x86 for detailed reference to setup and initialize AGL workspace.

    # After setting up AGL workspace
    
    # 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 build-x86-meta-ros-weston agl-devel
    $ 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"
      IMAGE_INSTALL_append = " packagegroup-ros-world-foxy"
      ROS_SUPERFLORE_GENERATED_WORLD_PACKAGES_remove = "plotjuggler"
      ROS_SUPERFLORE_GENERATED_WORLD_PACKAGES_remove = "plotjuggler-msgs"
      ROS_SUPERFLORE_GENERATED_WORLD_PACKAGES_remove = "plotjuggler-ros"
      ROS_SUPERFLORE_GENERATED_WORLD_PACKAGES_remove = "eigenpy"
      ROS_SUPERFLORE_GENERATED_WORLD_PACKAGES_remove = "py-trees-ros-tutorials"
        
    $ vim conf/bblayers.conf #Replace the following chunk
    # bblayers.conf
      AGL_META_NETWORKING ?= ""
      AGL_META_PYTHON = "${METADIR}/external/meta-openembedded/meta-python"
      AGL_META_ROS = " \
        ${METADIR}/external/meta-ros/meta-ros-common \
        ${METADIR}/external/meta-ros/meta-ros-backports-gatesgarth \
        ${METADIR}/external/meta-ros/meta-ros2 \
        ${METADIR}/external/meta-ros/meta-ros2-foxy \
        "
      AGL_OTHER_DEPENDENCY_LAYERS = " \
        ${AGL_META_NETWORKING} \
        ${AGL_META_PYTHON} \
        ${AGL_META_ROS} \
        "
    
    # Build the image
    
    $ cd $AGL_TOP/master/build-x86-meta-ros-weston/
    $ source agl-init-build-env #if not sourced
    $ bitbake -p ros-core #build ros-core first, to check all layers are added.
    $ time bitbake agl-image-weston #wait for the build process to finish.
    

Run master/x86: meta-ros + agl-image-weston

  • Kindly use pre-built image agl-image-weston-qemux86-64, if you want to skip the building process.

  • Kindly go through using prebuilt x86 images for detailed reference to setup and initialize AGL workspace.

    # gdrive : https://drive.google.com/drive/folders/13uSAtEIdVjWRo9tQSw7TMBEZGx0Gg5Zy?usp=sharing
      
    #  Install the dependencies
    $ apt-get install qemu
    $ sudo apt install vinagre
    $ sudo apt install qemu-system-x86
    
    # Copy image and kernel files
    $ cp ~/Downloads/agl-demo-platform-raspberrypi4-64.wic.xz ./
    $ cp ~/Downloads/bzImage ./
    $ sync
    
    # Run
    $ ( sleep 5 && vinagre --vnc-scale localhost ) > /tmp/vinagre.log 2>&1 &
        qemu-system-x86_64 -device virtio-net-pci,netdev=net0,mac=52:54:00:12:35:02 -netdev user,id=net0,hostfwd=tcp::2222-:22 \
        -drive file=agl-image-weston-qemux86-64.ext4,if=virtio,format=raw -show-cursor -usb -usbdevice tablet -device virtio-rng-pci \
        -device usb-host,hostbus=1,hostport=4 -vga virtio \
        -vnc :0 -soundhw hda -machine q35 -cpu kvm64 -cpu qemu64,+ssse3,+sse4.1,+sse4.2,+popcnt -enable-kvm \
        -m 2048 -serial mon:vc -serial mon:stdio -serial null -kernel bzImage \
        -append 'root=/dev/vda rw console=tty0 mem=2048M ip=dhcp oprofile.timer=1 console=ttyS0,115200n8 verbose fstab=no'
    
    #boots up
    qemu-system-x86_64: -usbdevice tablet: '-usbdevice' is deprecated, please use '-device usb-...' instead
    qemu-system-x86_64: warning: host doesn't support requested feature: CPUID.80000001H:ECX.svm [bit 2]
    
    Automotive Grade Linux 11.91.0+snapshot qemux86-64 ttyS1
    
    qemux86-64 login: root
    root@qemux86-64:~# source /usr/bin/ros_setup.sh
    root@qemux86-64:/# echo $LD_LIBRARY_PATH
      /usr/lib/x86_64-linux-gnu:/usr/lib
    root@qemux86-64:/# poweroff #else, runs in background
    

Build master/raspberrypi4: meta-ros + agl-image-weston

  • Kindly go through build process of AGL and building for raspberrypi4 for detailed reference to setup and initialize AGL workspace.

    # After setting up AGL workspace
    
    # 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 -f -m raspberrypi4 -b build-rpi4-meta-ros-weston agl-devel
    $ 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"
      IMAGE_INSTALL_append = " packagegroup-ros-world-foxy"
      ROS_SUPERFLORE_GENERATED_WORLD_PACKAGES_remove = "plotjuggler"
      ROS_SUPERFLORE_GENERATED_WORLD_PACKAGES_remove = "plotjuggler-msgs"
      ROS_SUPERFLORE_GENERATED_WORLD_PACKAGES_remove = "plotjuggler-ros"
      ROS_SUPERFLORE_GENERATED_WORLD_PACKAGES_remove = "eigenpy"
      ROS_SUPERFLORE_GENERATED_WORLD_PACKAGES_remove = "py-trees-ros-tutorials"
    
    $ vim conf/bblayers.conf #Replace the following chunk
    # bblayers.conf
      AGL_META_NETWORKING ?= ""
      AGL_META_PYTHON = "${METADIR}/external/meta-openembedded/meta-python"
      AGL_META_ROS = " \
        ${METADIR}/external/meta-ros/meta-ros-common \
        ${METADIR}/external/meta-ros/meta-ros-backports-gatesgarth \
        ${METADIR}/external/meta-ros/meta-ros2 \
        ${METADIR}/external/meta-ros/meta-ros2-foxy \
        "
      AGL_OTHER_DEPENDENCY_LAYERS = " \
        ${AGL_META_NETWORKING} \
        ${AGL_META_PYTHON} \
        ${AGL_META_ROS} \
        "
    
    # Build the image
      
    $ cd $AGL_TOP/master/build-rpi4-ros-demo/
    $ source agl-init-build-env #if not sourced
    $ bitbake -p ros-core #build ros-core first, to check all layers are added.
    $ time bitbake agl-image-weston #wait for the build process to finish.
    

Run master/raspberrypi4: meta-ros + agl-image-weston

  • Kindly use pre-built image agl-image-weston-raspberrypi4-64, if you want to skip the building process.

  • Kindly go through using prebuilt raspberrypi4 images for detailed reference to setup and initialize AGL workspace.

    ## gdrive : https://drive.google.com/drive/folders/16ek4xyWMP9UQcx2MHe78GjJOTXUFP4_t?usp=sharing
    
    # Copy image and extract into SD card
    $ cp ~/Downloads/agl-image-weston-raspberrypi4-64.wic.xz ./
    $ lsblk #find <SD_CARD>
    $ sudo umount <SD_CARD>
    $ xzcat agl-image-weston-raspberrypi4-64.wic.xz | sudo dd of=<SD_CARD> bs=4M
    $ sync
      
    # Boot up Pi and Run
      login: root
      ~# source /usr/bin/ros_setup.sh #source ros environment
      ~# echo $LD_LIBRARY_PATH #check if ros environment is sourced