Skip to main content
This pick-and-place simulated sample application uses the C++ based robotic manipulation ROS 2 node simulation_sample_pick_and_place to demonstrate autonomous pick-and-place operations using MoveIt2 for motion planning and Gazebo for physics simulation.
NoteFor more information, see simulation_sample_pick_and_place on GitHub.

Pipeline flow for simulation_sample_pick_and_place

image

ROS nodes used in the simulation_sample_pick_and_place pipeline

ROS nodeDescription
qrb_ros_simulationA ROS package that sets up the Qualcomm robotic simulation environment. For details, see QRB ROS Simulation.
simulation_sample_pick_and_placeSource code for pick-and-place.
moveit_ros_move_groupA ROS package that provides the MoveIt ROS MoveGroup interface. For details, see MoveIt MoveGroup.

ROS topics used in the simulation_sample_pick_and_place pipeline

ROS TopicsTypeDescription
/joint_statessensor_msgs/msg/JointStateReal-time data for all robot joints control information.
/hand_controller/controller_statecontrol_msgs.msg.ControllerStateCurrent state and status information of the gripper controller.
/rm_group_controller/controller_statecontrol_msgs.msg.ControllerStateCurrent state and status information of the robotic arm controller.
/robot_descriptionstd_msgs.msg.StringURDF robot description in XML format for robot modeling and visualization.
/robot_description_semanticstd_msgs.msg.StringSRDF semantic robot description for MoveIt planning and configuration.

Prerequisites

You have completed the following settings in Set up the environment for running sample applications.
  • Set up the device
  • Set up the host docker

Set up the simulation environment

  1. On your host computer, complete the following to build the Qualcomm robotic simulation environment according to the README of QRB ROS Simulation. Ensure that the device and the host are on the same local network and can communicate with each other through ROS communication.
    1. Set up development environment on Ubuntu24.04 host or Docker.
    2. Build from source.
  2. Run the qrb ros simulation on the host. Open a terminal and run the following commands to launch the Gazebo simulation environment:
    # Set the ROS_DOMAIN_ID
    (ssh) source install/setup.sh
    (ssh) export ROS_DOMAIN_ID=55
    (ssh) ros2 launch qrb_ros_sim_gazebo gazebo_rml_63_gripper.launch.py world_model:=warehouse initial_x:=2.2 initial_y:=-2 initial_z:=1.025 initial_yaw:=3.14159 initial_pitch:=0.0 initial_roll:=0.0 use_sim_time:=true
    
  3. Select the Play button in Gazebo to start the simulation, and then open another terminal and run the following commands to launch the controller manager:
    # Set the ROS_DOMAIN_ID
    (ssh) source install/setup.sh
    (ssh) export ROS_DOMAIN_ID=55
    (ssh) ros2 launch qrb_ros_sim_gazebo gazebo_rml_63_gripper_load_controller.launch.py
    

Run out-of-the-box simulation_sample_pick_and_place

  1. On the development kit, open a terminal and run the following commands to launch the moveit ROS move group:
    # setup runtime environment
    (ssh) source /usr/share/qirp-setup.sh
    # Set the ROS_DOMAIN_ID
    (ssh) export ROS_DOMAIN_ID=55
    (ssh) ros2 launch simulation_sample_pick_and_place simulation_sample_pick_and_place.launch.py
    
    If the ROS node is launched successfully, the log starting from [move_group-1] You can start planning now! appears.
  2. Open another terminal and run the following commands to launch the pick-and-place sample application:
    # setup runtime environment
    (ssh) source /usr/share/qirp-setup.sh
    # Set the ROS_DOMAIN_ID
    (ssh) export ROS_DOMAIN_ID=55
    (ssh) ros2 run simulation_sample_pick_and_place qrb_ros_arm_pick_place
    
Result If the ROS node launches successfully, you can see the robot arm performing the pick-and-place operation in Gazebo.

Build and run simulation_sample_pick_and_place

  1. In a terminal of the host computer, run the following commands:
    Note
    • <qir_version>: Version of the QIR SDK, see QIR SDK 2.0 Release Notes.
    • <qir_decompressed_path>: The path where you decompress the QIR SDK.
    1. Build the sample application project.
      # Set up the QIR SDK  environment
      (ssh) tar -zxf qirp-sdk_<qir_version>.tar.gz
      (ssh) cd <qir_decompressed_path>/qirp-sdk
      (ssh) source setup.sh
      # Build the sample
      (ssh) cd <qir_decompressed_path>/qirp-sdk/qirp-samples/robotics/simulation_sample_pick_and_place
      (ssh) chmod +x scripts/build.sh
      (ssh) bash scripts/build.sh
      
    2. Package and push the sample application to the device.
      # package and push build result of sample
      (ssh) cd <qir_decompressed_path>/qirp-sdk/qirp-amples/robotics/simulation_sample_pick_and_place/install
      (ssh) tar -czf simulation_sample_pick_and_place.tar.gz lib share
      (ssh) scp simulation_sample_pick_and_place.tar.gz root@[ip-addr]:/opt/
      
  2. On the development kit, run the following commands:
    1. Install the sample application.
      # Install sample package
      (ssh) tar --no-overwrite-dir --no-same-owner -zxf /opt/simulation_sample_pick_and_place.tar.gz -C /usr/ros/jazzy/
      
    2. Run the sample application with the steps in Run out-of-the-box simulation_sample_pick_and_place.