-
Notifications
You must be signed in to change notification settings - Fork 3
Notes
-
for std:
typedef std::shared_ptr<PointCloud> PointCloudSPtr;
typedef std::shared_ptr<const PointCloud> PointCloudConstSPtr;
-
for boost:
typedef PointCloud::Ptr PointCloudBSPtr;
typedef PointCloud::ConstPtr PointCloudConstBSPtr;
- Points to re-check in multimodal_object_recognition.cpp:
- Publish debug function : cluster_visualizer_pc_ and cluster_visualizer_rgb_ publishers - PointT was removed from the publish statements. Commented line still shows original.
- 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.
- The main ROS2 repository for Intel RealSense is here
- Install the latest Intel RealSense SDK 2.0 by using option 1 in the link above ( i.e. install from Linux Debian Installation Guide)
- Follow the installation steps 3-6 from the same ROS2 repository
- After a successful build run the below command to check
ros2 launch realsense2_camera rs_launch.py depth_module.profile:=1280x720x30 pointcloud.enable:=true
- Relevant topics to subscribe
/camera/color/camera_info
/camera/color/image_raw
/camera/depth/color/points
- 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.
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.
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.
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_);
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> ¶meters)
{
rcl_interfaces::msg::SetParametersResult result;
result.successful = true;
result.reason = "success";
for (const auto ¶m : 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 provides a way to adjust parameters during the run-time, with the help of a graphical user interface.
For additional details visit ROS2 parameters documentation..