Go to the documentation of this file.
35 using ErrorCb = std::function<void(
const std::string&)>;
37 using FatalCb = std::function<void(
const std::string&)>;
617 static constexpr
double NAN_VALUE = std::numeric_limits<double>::quiet_NaN();
697 std::multimap<int, ErrorCb, std::greater<int>>
errorCbs_;
713 std::multimap<int, FatalCb, std::greater<int>>
fatalCbs_;
std::function< void(const std::string &)> DeviceDisconnectedCb
virtual bool setAngularRateFilter(const unsigned int filter)=0
Sets an angular rate filter to the device. It's virtual since it's implementation-specific.
bool deviceIsInErrorState()
Checks if the device is in error state.
void startupWithoutCommunication()
Starts up a Rokubimini device before communication has been established by the BusManager.
std::atomic< bool > statuswordRequested_
Flag indicating if a statusword has been actively requested.
RosPublisherPtr dataFlagsDiagnosticsPublisher_
The Publisher for publishing Data Flags Diagnostics.
void addDeviceDisconnectedCb(const DeviceDisconnectedCb &deviceDisconnectedCb, const int priority=0)
Adds a device disconnencted callback to a list.
configuration::Configuration & getConfiguration()
Non-const version of getConfiguration() const. Gets the Configuration of the device.
virtual bool setForceTorqueOffset(const Eigen::Matrix< double, 6, 1 > &forceTorqueOffset)=0
Sets a force torque offset to the device. It's virtual since it's implementation-specific.
Reading reading_
The reading of the device.
virtual bool getSerialNumber(unsigned int &serialNumber)=0
Gets the serial number of the device. It's virtual since it's implementation-specific.
virtual bool setAccelerationFilter(const unsigned int filter)=0
Sets an acceleration filter to the device. It's virtual since it's implementation-specific.
void addDeviceReconnectedCb(const DeviceReconnectedCb &deviceReconnectedCb, const int priority=0)
Adds a device reconnected callback to a list.
virtual void load()
Loads the rokubimini configuration from the parameter server.
Class representing a rokubi mini device.
std::string getName() const
Gets the name of the device.
void errorRecoveredCb()
Calls the callbacks in the error recovered callbacks list.
void fatalRecoveredCb()
Calls the callbacks in the fatal recovered callbacks list.
virtual void postSetupConfiguration()=0
Post-setup configuration hook.
virtual void publishRosMessages()=0
Publishes ROS messages with data from the rokubimini device. It's virtual because it's implementation...
void startupWithCommunication()
Starts up a Rokubimini device after communication has been established.
TimerPtr dataFlagsDiagnosticsTimer_
A timer for running the Data Flags Diagnostics update callback.
virtual bool setForceTorqueFilter(const configuration::ForceTorqueFilter &filter)=0
Sets a force torque filter to the device. It's virtual since it's implementation-specific.
Reading getReading() const
Gets the reading from the Rokubimini device.
void fatalCb()
Calls the callbacks in the fatal callbacks list.
std::string productName_
The product name of the rokubimini.
void addErrorCb(const ErrorCb &errorCb, const int priority=0)
Adds an error callback to a list.
Rokubimini(const std::string &name, NodeHandlePtr nh)
Class representing the readings received from the rokubi mini devices.
virtual void createRosPublishers()=0
Creates ROS publishers for the rokubimini device. It's virtual because it's implementation specific.
virtual void shutdownWithCommunication()=0
Shuts down a Rokubimini device before communication has been closed.
void addFatalCb(const FatalCb &fatalCb, const int priority=0)
Adds an fatal callback to a list.
std::shared_ptr< ros::Timer > TimerPtr
std::string name_
The name of the device.
Rokubimini()=default
Default constructor.
void addReadingCb(const ReadingCb &readingCb, const int priority=0)
Adds a reading callback to a list.
Class holding the force-torque filter settings.
std::multimap< int, FatalCb, std::greater< int > > fatalCbs_
void deviceDisconnectedCb()
Calls the callbacks in the device disconnected callbacks list.
virtual bool setSensorCalibration(const calibration::SensorCalibration &sensorCalibration)=0
Sets a sensor calibration to the device. It's virtual since it's implementation-specific.
std::function< void(const std::string &)> DeviceReconnectedCb
Statusword statusword_
The current statusword.
virtual bool deviceIsMissing() const =0
Checks if the device is missing.
std::multimap< int, DeviceDisconnectedCb, std::greater< int > > deviceDisconnectedCbs_
virtual void updateProcessReading()=0
Updates the Rokubimini object with new measurements.
std::function< void(void)> AnonymousErrorCb
void errorCb()
Calls the callbacks in the error callbacks list.
std::multimap< int, ErrorRecoveredCb, std::greater< int > > errorRecoveredCbs_
Statusword getStatusword() const
Gets the statusword of the device.
std::shared_ptr< ros::Publisher > RosPublisherPtr
std::function< void(const std::string &)> ErrorRecoveredCb
DiagnosticsUpdaterPtr connectionStatusUpdater_
The Connection Status diagnostics updater.
std::function< void(const std::string &)> ErrorCb
NodeHandlePtr nh_
The node handle of the ROS node, used by the publishers.
std::multimap< int, ErrorCb, std::greater< int > > errorCbs_
std::string getProductName() const
Gets the product name of the device.
virtual void createRosDiagnostics()=0
Creates ROS diagnostics for the rokubimini device. It's virtual because it's implementation specific.
const configuration::Configuration & getConfiguration() const
void setStatusword(Statusword &statusword)
Sets the statusword of the device.
Class holding the configuration of the sensor.
virtual ~Rokubimini()=default
virtual void shutdownWithoutCommunication()
static constexpr double NAN_VALUE
NaN abbreviation for convenience.
bool deviceIsInFatalState()
Checks if the device is in fatal state.
Class holding the sensor configuration settings.
virtual void publishRosDiagnostics()=0
Publishes ROS diagnostics from the rokubimini device. It's virtual because it's implementation specif...
std::function< void(const Reading &)> AnonymousReadingCb
virtual void preSetupConfiguration()=0
Pre-setup configuration hook.
void setNodeHandle(const NodeHandlePtr &nh)
Sets the nodeHandle of the device.
virtual bool setAngularRateRange(const unsigned int range)=0
Sets an angular rate range to the device. It's virtual since it's implementation-specific.
void addErrorRecoveredCb(const ErrorRecoveredCb &errorRecoveredCb, const int priority=0)
Adds an error recovered callback to a list.
std::function< void(const std::string &)> FatalCb
virtual bool getForceTorqueSamplingRate(int &samplingRate)=0
Gets the force torque sampling rate of the device. It's virtual since it's implementation-specific.
configuration::Configuration configuration_
The Configuration of the device.
The SensorCalibration class is used for holding the calibration information of each rokubi mini senso...
std::recursive_mutex readingMutex_
The mutex for accessing the reading.
virtual bool setAccelerationRange(const unsigned int range)=0
Sets an acceleration range to the device. It's virtual since it's implementation-specific.
std::multimap< int, FatalRecoveredCb, std::greater< int > > fatalRecoveredCbs_
virtual void createRosServices()=0
Creates ROS services for the rokubimini device. It's virtual because it's implementation specific.
virtual bool saveConfigParameter()=0
Saves the current configuration to the device. It's virtual since it's implementation-specific.
void deviceReconnectedCb()
Calls the callbacks in the device reconnected callbacks list.
std::shared_ptr< ros::NodeHandle > NodeHandlePtr
Class representing the different states the communication or the sensors can be in.
void clearGoalStateEnum()
Clears the goal state enumeration.
std::function< void(const std::string &, const Reading &)> ReadingCb
std::multimap< int, ReadingCb, std::greater< int > > readingCbs_
std::shared_ptr< diagnostic_updater::Updater > DiagnosticsUpdaterPtr
std::function< void(const std::string &)> FatalRecoveredCb
std::multimap< int, DeviceReconnectedCb, std::greater< int > > deviceReconnectedCbs_
virtual bool setSensorConfiguration(const configuration::SensorConfiguration &sensorConfiguration)=0
Sets a sensor configuration to the device. It's virtual since it's implementation-specific.
void addFatalRecoveredCb(const FatalRecoveredCb &fatalRecoveredCb, const int priority=0)
Adds an fatal recovered callback to a list.
rokubimini
Author(s):
autogenerated on Sat Apr 15 2023 02:53:52