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(
"color_topic_name");
34 params.push_back(
"depth_topic_name");
35 params.push_back(
"force_info_synch");
36 params.push_back(
"depth_frame_id");
37 params.push_back(
"color_frame_id");
44 if (paramName ==
"period")
46 paramValue = std::to_string(
m_period);
49 if (paramName ==
"node_name")
54 if (paramName ==
"color_topic_name")
59 if (paramName ==
"depth_topic_name")
64 if (paramName ==
"force_info_synch")
69 if (paramName ==
"depth_frame_id")
74 if (paramName ==
"color_frame_id")
80 yError() <<
"parameter '" << paramName <<
"' was not found";
99 if (config.
check(
"help"))
108 if (config.
check(
"period"))
111 yCInfo(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Parameter 'period' using value:" <<
m_period;
115 yCInfo(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Parameter 'period' using DEFAULT value:" <<
m_period;
117 prop_check.
unput(
"period");
122 if (config.
check(
"node_name"))
125 yCInfo(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Parameter 'node_name' using value:" <<
m_node_name;
129 yCError(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Mandatory parameter 'node_name' not found!";
130 yCError(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Description of the parameter: name of the ros2 node";
133 prop_check.
unput(
"node_name");
138 if (config.
check(
"color_topic_name"))
145 yCError(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Mandatory parameter 'color_topic_name' not found!";
146 yCError(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Description of the parameter: ros rgb topic (it's also the base name for the rgb camera_info topic)";
149 prop_check.
unput(
"color_topic_name");
154 if (config.
check(
"depth_topic_name"))
161 yCError(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Mandatory parameter 'depth_topic_name' not found!";
162 yCError(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Description of the parameter: ros depth topic (it's also the base name for the depth camera_info topic)";
165 prop_check.
unput(
"depth_topic_name");
170 if (config.
check(
"force_info_synch"))
177 yCInfo(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Parameter 'force_info_synch' using DEFAULT value:" <<
m_force_info_synch;
179 prop_check.
unput(
"force_info_synch");
184 if (config.
check(
"depth_frame_id"))
187 yCInfo(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Parameter 'depth_frame_id' using value:" <<
m_depth_frame_id;
191 yCError(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Mandatory parameter 'depth_frame_id' not found!";
192 yCError(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Description of the parameter: The depth image frame";
195 prop_check.
unput(
"depth_frame_id");
200 if (config.
check(
"color_frame_id"))
203 yCInfo(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Parameter 'color_frame_id' using value:" <<
m_color_frame_id;
207 yCError(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Mandatory parameter 'color_frame_id' not found!";
208 yCError(RgbdSensor_nws_ros2ParamsCOMPONENT) <<
"Description of the parameter: The color image frame";
211 prop_check.
unput(
"color_frame_id");
246 doc = doc + std::string(
"\n=============================================\n");
247 doc = doc + std::string(
"This is the help for device: RgbdSensor_nws_ros2\n");
248 doc = doc + std::string(
"\n");
249 doc = doc + std::string(
"This is the list of the parameters accepted by the device:\n");
250 doc = doc + std::string(
"'period': refresh period of the broadcasted values in s\n");
251 doc = doc + std::string(
"'node_name': name of the ros2 node\n");
252 doc = doc + std::string(
"'color_topic_name': ros rgb topic (it's also the base name for the rgb camera_info topic)\n");
253 doc = doc + std::string(
"'depth_topic_name': ros depth topic (it's also the base name for the depth camera_info topic)\n");
254 doc = doc + std::string(
"'force_info_synch': if 1, it forces synching images time stamp with and cameras time stamp\n");
255 doc = doc + std::string(
"'depth_frame_id': The depth image frame\n");
256 doc = doc + std::string(
"'color_frame_id': The color image frame\n");
257 doc = doc + std::string(
"\n");
258 doc = doc + std::string(
"Here are some examples of invocation command with yarpdev, with all params:\n");
259 doc = doc +
" yarpdev --device rgbdSensor_nws_ros2 --period 0.02 --node_name <mandatory_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>\n";
260 doc = doc + std::string(
"Using only mandatory params:\n");
261 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";
262 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,...)