# Generate and install slam-gmapping IPKs

Source: [https://docs.qualcomm.com/doc/80-70015-265/topic/generate-and-install-slam-gmapping-ipks_5_1_2.html](https://docs.qualcomm.com/doc/80-70015-265/topic/generate-and-install-slam-gmapping-ipks_5_1_2.html)

Manually generate the slam-gmapping IPK files and install to the device.

## About this task

**Generation**

**Steps:**

## Procedure

1. Create a folder named `slam-gmapping` in
            `<workspace>/layers/meta-qcom-robotics/recipes`. Then, write two
          recipes in the `slam-gmapping`folder: `openslam-gmapping.bb`
          and `slam-gmapping.bb`.
        
openslam-gmapping.bb sample code:

        inherit ros_distro_humble
        inherit ros_component
        
        DESCRIPTION = "Openslam gmapping"
        LICENSE = "CreativeCommons-by-nc-sa-2.0"
        LIC_FILES_CHKSUM = "file://package.xml;beginline=8;endline=8;md5=d566ef916e9dedc494f5f793a6690ba5"
        
        DEPENDS += "ament-cmake-native ament-cmake"
        ROS_BRANCH ?= "branch=eloquent-devel"
        SRC_URI = "git://github.com/Project-MANAS/slam_gmapping.git;${ROS_BRANCH};protocol=https"
        SRCREV = "771cfc7eae454aecb4e83c22a0b88656f2880c6c"
        S = "${WORKDIR}/git/openslam_gmapping"
        
        ROS_BUILD_TYPE = "ament_cmake"
        
        inherit ros_${ROS_BUILD_TYPE} robotics-package
        
        FILES:${PN}:prepend = "${datadir}/openslam_gmapping"
        FILES:${PN} += "${libdir}/*"
        
        PACKAGES = "qirf-${PN}"
        
        INSANE_SKIP:${PN} += "installed-vs-shipped"Copy to clipboard

slam-gmapping.bb sample code:

        inherit ros_distro_humble
        inherit ros_component
        
        DESCRIPTION = "Slam gmapping"
        LICENSE          = "Qualcomm-Technologies-Inc.-Proprietary"
        LIC_FILES_CHKSUM = "file://package.xml;beginline=13;endline=13;md5=d566ef916e9dedc494f5f793a6690ba5"
        
        DEPENDS += " \
            ament-cmake-native \
            ament-cmake \
            std-msgs \
            nav-msgs \
            tf2 \
            tf2-ros \
            tf2-geometry-msgs \
            message-filters \
            rclcpp \
            sensor-msgs \
            visualization-msgs \
            openslam-gmapping \
        "
        
        CXXFLAGS += "-Wno-format-security"
        
        ROS_BRANCH ?= "branch=eloquent-devel"
        SRC_URI = "git://github.com/Project-MANAS/slam_gmapping.git;${ROS_BRANCH};protocol=https"
        SRCREV = "771cfc7eae454aecb4e83c22a0b88656f2880c6c"
        S = "${WORKDIR}/git/slam_gmapping"
        
        ROS_BUILD_TYPE = "ament_cmake"
        
        inherit ros_${ROS_BUILD_TYPE} robotics-package
        
        FILES:${PN}:prepend = "${datadir}/slam_gmapping"
        FILES:${PN} += "${libdir}/*"
        
        PACKAGES = "qirf-${PN}"
        
        INSANE_SKIP:${PN} += "installed-vs-shipped"Copy to clipboard
2. Use the Yocto mechanism to compile the two recipes. The compilation generates the IPKs
          in the relative build directory.
        
cd <workspace>
        MACHINE=qcm6490 DISTRO=qcom-robotics-ros2-humble source setup-robotics-environment
        bitbake openslam-gmapping -c do_package_write_ipk
        bitbake slam-gmapping -c do_package_write_ipk
        Copy to clipboard

The following IPKs `<slam-gmapping.ipks>` are generated:

    - `<workspace>/build-qcom-robotics-ros2-humble/tmp-glibc/work/armv8-2a-qcom-linux/openslam-gmapping/1.0-r0/deploy-ipks/armv8-2a/qirf-openslam-gmapping_1.0-r0_armv8-2a.ipk`
    - `<workspace>/build-qcom-robotics-ros2-humble/tmp-glibc/work/armv8-2a-qcom-linux/slam-gmapping/1.0-r0/deploy-ipks/armv8-2a/qirf-slam-gmapping_1.0-r0_armv8-2a.ipk
              `

## Results

**Installation**

**Steps:**

1. Install the IPK files to the
          device.

        scp <slam_gmapping.ipks> root@[ip-addr]:/opt/
        ssh root@[ip-addr]
        (ssh) cd /opt/
        (ssh) opkg install --force-reinstall --force-overwrite --force-depends *.ipkCopy to clipboard
2. In the `/opt/qcom/qirf-sdk/usr/share/slam_gmapping/launch` folder of your
          device, modify the `slam_gmapping.launch.py` as follows . Then the
            `slam_gmapping` node can run
          properly.

        from launch import LaunchDescription
        from launch.substitutions import EnvironmentVariable
        import launch.actions
        import launch_ros.actions
        
        def generate_launch_description():
            use_sim_time = launch.substitutions.LaunchConfiguration('use_sim_time', default='false')
            return LaunchDescription([
                launch_ros.actions.Node(
                    package='slam_gmapping', executable='slam_gmapping', output='screen', parameters=[{'use_sim_time':use_sim_time}]),
            ])Copy to clipboard

**Parent Topic:** [Set up the runtime environment for samples](https://docs.qualcomm.com/doc/80-70015-265/topic/set-up-the-runtime-environment-for-samples_5_1.html)

Last Published: Oct 15, 2024

[Previous Topic
Set up the runtime environment for samples](https://docs.qualcomm.com/bundle/publicresource/80-70015-265/topics/set-up-the-runtime-environment-for-samples_5_1.md) [Next Topic
Install Rviz2](https://docs.qualcomm.com/bundle/publicresource/80-70015-265/topics/install-rviz2_5_1_3.md)