18 #ifndef MAUVE_ROS_SHELL_HPP 19 #define MAUVE_ROS_SHELL_HPP 24 #include <mauve/runtime.hpp> 25 #include "Connector.hpp" 37 runtime::Property<std::string>&
topic = mk_property<std::string>(
"topic",
"");
46 template <
typename T,
typename U>
52 runtime::Property<conversion_t>& conversion = mk_property<conversion_t>(
59 this->
template mk_read_port<runtime::StatusValue<T>>(
"read",
60 { runtime::DataStatus::NO_DATA, T() });
63 this->
template mk_write_port<U>(
"write");
67 if (this->conversion.get_value() ==
nullptr) {
68 this->
logger().
error(
"conversion function not implemented");
94 this->topic =
topic; this->conversion.set_value(convert); };
runtime::Property< std::string > & topic
Topic property.
Definition: Shell.hpp:37
virtual bool configure_hook()
Configure shell: init ROS node.
Definition: Shell.hpp:66
Definition: HasPort.hpp:33
ROS Connector interface.
Definition: Connector.hpp:31
void error(const char *fmt, const Args &...args)
Log a message at ERROR level.
Definition: logger.ipp:59
RosShell(const std::string &topic, const conversion_t &convert)
Constructor with conversion and topic.
Definition: Shell.hpp:93
ROS Abstract Shell.
Definition: Shell.hpp:32
RosShell(const conversion_t &convert)
Constructor with conversion.
Definition: Shell.hpp:87
AbstractLogger & logger() const override
Get the logger.
Definition: Shell.hpp:77
ROS Shell for conversion.
Definition: Shell.hpp:47
RosShell(const std::string &topic)
Constructor with topic.
Definition: Shell.hpp:82
The MAUVE namespace.
Definition: tracing.hpp:24
A Shell is the interface of a component.
Definition: Shell.hpp:48
std::function< bool(const T &, U &)> conversion_t
Type of the conversion functions.
Definition: Shell.hpp:50
RosShell()
Default constructor.
Definition: Shell.hpp:77
virtual bool configure_hook()
Configure shell: init ROS node.