Skip to content
Vamsi Kalagaturu edited this page Sep 11, 2022 · 17 revisions

Pointer typedefs

  1. for std:
    typedef std::shared_ptr<PointCloud> PointCloudSPtr;
    typedef std::shared_ptr<const PointCloud> PointCloudConstSPtr;

  2. for boost:
    typedef PointCloud::Ptr PointCloudBSPtr;
    typedef PointCloud::ConstPtr PointCloudConstBSPtr;

  • Points to re-check in multimodal_object_recognition.cpp:
    1. Publish debug function : cluster_visualizer_pc_ and cluster_visualizer_rgb_ publishers - PointT was removed from the publish statements. Commented line still shows original.
    2. Datacollection : code written in main node in recognize point cloud function, and parameter defined in constructor. move them once inheritance between nodes is figured out.

Intel RealSense package setup:

  1. The main ROS2 repository for Intel RealSense is here
  2. Install the latest Intel RealSense SDK 2.0 by using option 1 in the link above ( i.e. install from Linux Debian Installation Guide)
  3. Follow the installation steps 3-6 from the same ROS2 repository
  4. After a successful build run the below command to check
ros2 launch realsense2_camera rs_launch.py depth_module.profile:=1280x720x30 pointcloud.enable:=true
  1. Relevant topics to subscribe
/camera/color/camera_info
/camera/color/image_raw
/camera/depth/color/points

Data collector node:

  • The data collector node, or rather, a component, is written as a separate executable, in order to provide the user the functionality of recording the pointcloud and the RGB image information from the multimodal object recognition node, but without executing all the other functionalities included in it, like the RGB and pointcloud based object recognition. The current application of this component is limited to being a minimal version of the mmor node that can be executed to store the pointcloud and RGB image, but additional applications are being considered.

Dynamic parameters:

Introduction

Individual nodes in ROS are linked to specific parameters. Without modifying the code, dynamic parameters are utilized to configure nodes at startup and throughout the operation. Each parameter can be declared with a name, a value, and a descriptor. 

Initial parameter setting

The initial parameter values can be set when executing the node using YAML files. The mmor node will be launched using parameter values that are taken directly from the YAML configuration file - scene_segmentation_constraints.yaml by the launch file - mmor_launch.py. It is simple to store and load a large number of variables when arguments and parameters are defined in YAML files.

Parameter declaration

A node must by default declare every parameter that it will take in throughout its existence. In this project, in parameters.cpp file, all dynamic parameters are declared in function MultiModalObjectRecognitionROS::declare_all_parameters().

Example:

rcl_interfaces::msg::ParameterDescriptor debug_mode_descriptor;
debug_mode_descriptor.description = "Debug mode";
debug_mode_descriptor.type = rcl_interfaces::msg::ParameterType::PARAMETER_BOOL;
this->declare_parameter("debug_mode", true, debug_mode_descriptor);
this->get_parameter("debug_mode", debug_mode_);

Parameter callbacks

A ROS 2 node can register two different sorts of callbacks to be notified when parameters change. The first type callback is called a "set parameter" callback, while the second type is called an "on parameter event" callback. The multimodal_object_recognition node registers for "set parameter" callback type. The Function MultiModalObjectRecognitionROS::parametersCallback() in parameters.cpp file performs parameter callbacks.

Example:

rcl_interfaces::msg::SetParametersResult
  MultiModalObjectRecognitionROS::parametersCallback(
      const std::vector<rclcpp::Parameter> &parameters)
  {
    rcl_interfaces::msg::SetParametersResult result;
    result.successful = true;
    result.reason = "success";

    for (const auto &param : parameters)
    {
      RCLCPP_INFO(this->get_logger(), "Value of param %s changed to %s", param.get_name().c_str(), param.value_to_string().c_str());
      if (param.get_name() == "debug_mode")
      {
        this->debug_mode_ = param.get_value<bool>();
      }
    }
    return result;
  }

rqt_reconfigure

rqt_reconfigure provides a way to adjust parameters during the run-time, with the help of a graphical user interface. dynamic parameters in rqt reconfigure

For additional details visit ROS2 parameters documentation..