19 YARP_LOG_COMPONENT(RgbdSensor_nws_ros2ParamsCOMPONENT,
"yarp.device.RgbdSensor_nws_ros2")
30 std::vector<std::string> params;
31 params.push_back(
"period");
32 params.push_back(
"node_name");
33 params.push_back(
"namespace");
34 params.push_back(
"color_topic_name");
35 params.push_back(
"depth_topic_name");
36 params.push_back(
"force_info_synch");
37 params.push_back(
"depth_frame_id");
38 params.push_back(
"color_frame_id");
39 params.push_back(
"pub_status_topic");
46 if (paramName ==
"period")
48 paramValue = std::to_string(
m_period);
51 if (paramName ==
"node_name")
56 if (paramName ==
"namespace")
61 if (paramName ==
"color_topic_name")
66 if (paramName ==
"depth_topic_name")
71 if (paramName ==
"force_info_synch")
76 if (paramName ==
"depth_frame_id")
81 if (paramName ==
"color_frame_id")
86 if (paramName ==
"pub_status_topic")
92 yError() <<
"parameter '" << paramName <<
"' was not found";
111 if (config.
check(
"help"))
120 if (config.
check(
"period"))
123 yCInfo(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Parameter 'period' using value:" <<
m_period;
127 yCInfo(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Parameter 'period' using DEFAULT value:" <<
m_period;
129 prop_check.
unput(
"period");
134 if (config.
check(
"node_name"))
137 yCInfo(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Parameter 'node_name' using value:" <<
m_node_name;
141 yCError(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Mandatory parameter 'node_name' not found!";
142 yCError(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Description of the parameter: name of the ros2 node";
145 prop_check.
unput(
"node_name");
150 if (config.
check(
"namespace"))
153 yCInfo(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Parameter 'namespace' using value:" <<
m_namespace;
157 yCInfo(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Parameter 'namespace' using DEFAULT value:" <<
m_namespace;
159 prop_check.
unput(
"namespace");
164 if (config.
check(
"color_topic_name"))
171 yCError(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Mandatory parameter 'color_topic_name' not found!";
172 yCError(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Description of the parameter: ros rgb topic (it's also the base name for the rgb camera_info topic)";
175 prop_check.
unput(
"color_topic_name");
180 if (config.
check(
"depth_topic_name"))
187 yCError(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Mandatory parameter 'depth_topic_name' not found!";
188 yCError(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Description of the parameter: ros depth topic (it's also the base name for the depth camera_info topic)";
191 prop_check.
unput(
"depth_topic_name");
196 if (config.
check(
"force_info_synch"))
203 yCInfo(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Parameter 'force_info_synch' using DEFAULT value:" <<
m_force_info_synch;
205 prop_check.
unput(
"force_info_synch");
210 if (config.
check(
"depth_frame_id"))
213 yCInfo(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Parameter 'depth_frame_id' using value:" <<
m_depth_frame_id;
217 yCError(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Mandatory parameter 'depth_frame_id' not found!";
218 yCError(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Description of the parameter: The depth image frame";
221 prop_check.
unput(
"depth_frame_id");
226 if (config.
check(
"color_frame_id"))
229 yCInfo(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Parameter 'color_frame_id' using value:" <<
m_color_frame_id;
233 yCError(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Mandatory parameter 'color_frame_id' not found!";
234 yCError(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Description of the parameter: The color image frame";
237 prop_check.
unput(
"color_frame_id");
242 if (config.
check(
"pub_status_topic"))
249 yCInfo(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Parameter 'pub_status_topic' using DEFAULT value:" <<
m_pub_status_topic;
251 prop_check.
unput(
"pub_status_topic");
286 doc = doc + std::string(
"\n=============================================\n");
287 doc = doc + std::string(
"This is the help for device: RgbdSensor_nws_ros2\n");
288 doc = doc + std::string(
"\n");
289 doc = doc + std::string(
"This is the list of the parameters accepted by the device:\n");
290 doc = doc + std::string(
"'period': refresh period of the broadcasted values in s\n");
291 doc = doc + std::string(
"'node_name': name of the ros2 node\n");
292 doc = doc + std::string(
"'namespace': optional namespace for ros2 node\n");
293 doc = doc + std::string(
"'color_topic_name': ros rgb topic (it's also the base name for the rgb camera_info topic)\n");
294 doc = doc + std::string(
"'depth_topic_name': ros depth topic (it's also the base name for the depth camera_info topic)\n");
295 doc = doc + std::string(
"'force_info_synch': if 1, it forces synching images time stamp with and cameras time stamp\n");
296 doc = doc + std::string(
"'depth_frame_id': The depth image frame\n");
297 doc = doc + std::string(
"'color_frame_id': The color image frame\n");
298 doc = doc + std::string(
"'pub_status_topic': If 1 a topic publishing 0 if no image has been published on ros2 topic, 1 if only the RGB image is bein published, 2 for only the depth image, and 3 for both images will be opened\n");
299 doc = doc + std::string(
"\n");
300 doc = doc + std::string(
"Here are some examples of invocation command with yarpdev, with all params:\n");
301 doc = doc +
" yarpdev --device rgbdSensor_nws_ros2 --period 0.02 --node_name <mandatory_value> --namespace <optional_value> --color_topic_name <mandatory_value> --depth_topic_name <mandatory_value> --force_info_synch 0 --depth_frame_id <mandatory_value> --color_frame_id <mandatory_value> --pub_status_topic 0\n";
302 doc = doc + std::string(
"Using only mandatory params:\n");
303 doc = doc +
" yarpdev --device rgbdSensor_nws_ros2 --node_name <mandatory_value> --color_topic_name <mandatory_value> --depth_topic_name <mandatory_value> --depth_frame_id <mandatory_value> --color_frame_id <mandatory_value>\n";
304 doc = doc + std::string(
"=============================================\n\n");
return doc;
RgbdSensor_nws_ros2_ParamsParser()
std::vector< std::string > getListOfParams() const override
Return a list of all params used by the device.
std::string m_provided_configuration
bool getParamValue(const std::string ¶mName, std::string ¶mValue) const override
Return the value (represented as a string) of the requested parameter.
std::string m_depth_topic_name
std::string m_color_topic_name
std::string m_color_frame_id
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
std::string getDocumentationOfDeviceParams() const override
Get the documentation of the DeviceDriver's parameters.
std::string m_depth_frame_id
std::string getConfiguration() const override
Return the configuration of the device.
A class for storing options and configuration information.
void unput(const std::string &key)
Remove the association from the given key to a value, if present.
A base class for nested structures that can be searched.
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
virtual std::string toString() const =0
Return a standard text representation of the content of the object.
virtual Value & find(const std::string &key) const =0
Gets a value corresponding to a given keyword.
#define yCInfo(component,...)
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)