10 std::string prefix =
"rokubiminis/" +
name_;
11 std::string product_name_string = prefix +
"/product_name";
12 if (
nh_->hasParam(product_name_string))
18 ROS_ERROR(
"Could not find product name in Parameter Server: %s", product_name_string.c_str());
93 error_recovered_cb.second(
getName());
116 fatal_recovered_cb.second(
getName());
132 device_disconnected_cb.second(
getName());
166 reading_cb.second(
getName(), reading);
175 device_reconnected_cb.second(
getName());
203 std::vector<std::string> infos;
204 std::vector<std::string> warnings;
205 std::vector<std::string> errors;
206 std::vector<std::string> fatals;
208 for (
const std::string& info : infos)
212 for (
const std::string& warning : warnings)
216 for (
const std::string& error : errors)
220 for (
const std::string& fatal : fatals)
bool getUseCustomCalibration() const
Gets the useCustomCalibration variable.
const WrenchType & getWrench() const
Gets the wrench variable.
unsigned int getImuAccelerationFilter() const
bool deviceIsInErrorState()
Checks if the device is in error state.
bool hasImuAccelerationRange() const
Checks if the value of the imuAccelerationRange_ variable has been set by the user in the configurati...
std::multimap< int, FatalRecoveredCb, std::greater< int > > fatalRecoveredCbs_
uint32_t getData() const
Gets the data variable.
virtual bool setSensorCalibration(const calibration::SensorCalibration &sensorCalibration)=0
Sets a sensor calibration to the device. It's virtual since it's implementation-specific.
void deviceDisconnectedCb()
Calls the callbacks in the device disconnected callbacks list.
Statusword statusword_
The current statusword.
bool deviceIsInFatalState()
Checks if the device is in fatal state.
const ForceTorqueFilter & getForceTorqueFilter() const
Gets the forceTorqueFilter variable.
void setStatusword(Statusword &statusword)
Sets the statusword of the device.
static constexpr double NAN_VALUE
NaN abbreviation for convenience.
std::string getName() const
Gets the name of the device.
virtual bool setForceTorqueFilter(const configuration::ForceTorqueFilter &filter)=0
Sets a force torque filter to the device. It's virtual since it's implementation-specific.
void errorRecoveredCb()
Calls the callbacks in the error recovered callbacks list.
NodeHandlePtr nh_
The node handle of the ROS node, used by the publishers.
virtual bool setAccelerationRange(const unsigned int range)=0
Sets an acceleration range to the device. It's virtual since it's implementation-specific.
bool hasForceTorqueOffset() const
Checks if the value of the forceTorqueOffset_ variable has been set by the user in the configuration ...
std::multimap< int, FatalCb, std::greater< int > > fatalCbs_
virtual bool setAngularRateRange(const unsigned int range)=0
Sets an angular rate range to the device. It's virtual since it's implementation-specific.
Class representing the readings received from the rokubi mini devices.
void load(const std::string &key, const NodeHandlePtr &nh)
Loads the configuration from the parameter server.
void clearGoalStateEnum()
Clears the goal state enumeration.
unsigned int getImuAngularRateFilter() const
Gets the imuAccelerationFilter variable.
Class representing the different states the communication or the sensors can be in.
void startupWithoutCommunication()
Starts up a Rokubimini device before communication has been established by the BusManager.
uint8_t getImuAccelerationRange() const
Gets the imuAccelerationRange variable.
std::string productName_
The product name of the rokubimini.
bool hasForceTorqueFilter() const
Checks if the value of the forceTorqueFilter_ variable has been set by the user in the configuration ...
bool isEmpty() const
Checks whether the statusword is empty.
const ImuType & getImu() const
Gets the imu variable.
const Eigen::Matrix< double, 6, 1 > & getForceTorqueOffset() const
Gets the forceTorqueOffset variable.
void getMessagesDiff(Statusword &previousStatusword, std::vector< std::string > &infos, std::vector< std::string > &warnings, std::vector< std::string > &errors, std::vector< std::string > &fatals) const
Gets the different messages form the previous statusword.
std::multimap< int, DeviceReconnectedCb, std::greater< int > > deviceReconnectedCbs_
TimePoint getStamp() const
Gets the stamp variable.
virtual void load()
Loads the rokubimini configuration from the parameter server.
configuration::Configuration configuration_
The Configuration of the device.
virtual void preSetupConfiguration()=0
Pre-setup configuration hook.
void deviceReconnectedCb()
Calls the callbacks in the device reconnected callbacks list.
void setStatusword(const Statusword &statusword)
Sets the statusword variable.
bool hasSensorConfiguration() const
Checks if the value of the sensorConfiguration_ variable has been set by the user in the configuratio...
void errorCb()
Calls the callbacks in the error callbacks list.
std::atomic< bool > statuswordRequested_
Flag indicating if a statusword has been actively requested.
bool hasImuAccelerationFilter() const
Checks if the value of the imuAccelerationFilter_ variable has been set by the user in the configurat...
std::multimap< int, ErrorCb, std::greater< int > > errorCbs_
#define ROS_WARN_STREAM(args)
#define ROS_DEBUG_STREAM(args)
std::multimap< int, DeviceDisconnectedCb, std::greater< int > > deviceDisconnectedCbs_
void fatalCb()
Calls the callbacks in the fatal callbacks list.
bool hasSensorCalibration() const
Checks if the value of the sensorCalibration_ variable has been set by the user in the configuration ...
Reading reading_
The reading of the device.
bool hasSaveConfiguration() const
Checks if the value of the saveConfiguration_ variable has been set by the user in the configuration ...
Reading getReading() const
Gets the reading from the Rokubimini device.
std::multimap< int, ErrorRecoveredCb, std::greater< int > > errorRecoveredCbs_
#define ROS_INFO_STREAM(args)
uint8_t getImuAngularRateRange() const
Gets the imuAngularRateRange variable.
virtual bool setAccelerationFilter(const unsigned int filter)=0
Sets an acceleration filter to the device. It's virtual since it's implementation-specific.
void fatalRecoveredCb()
Calls the callbacks in the fatal recovered callbacks list.
void startupWithCommunication()
Starts up a Rokubimini device after communication has been established.
std::multimap< int, ReadingCb, std::greater< int > > readingCbs_
virtual bool setAngularRateFilter(const unsigned int filter)=0
Sets an angular rate filter to the device. It's virtual since it's implementation-specific.
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.
bool getSaveConfiguration() const
Gets the saveConfiguration variable.
#define ROS_ERROR_STREAM(args)
virtual void postSetupConfiguration()=0
Post-setup configuration hook.
const calibration::SensorCalibration & getSensorCalibration() const
Gets the sensorCalibration variable.
configuration::Configuration & getConfiguration()
Non-const version of getConfiguration() const. Gets the Configuration of the device.
std::string name_
The name of the device.
virtual bool saveConfigParameter()=0
Saves the current configuration to the device. It's virtual since it's implementation-specific.
std::recursive_mutex readingMutex_
The mutex for accessing the reading.
bool hasImuAngularRateFilter() const
Checks if the value of the imuAngularRateFilter_ variable has been set by the user in the configurati...
const SensorConfiguration & getSensorConfiguration() const
Gets the sensorConfiguration variable.
virtual bool setSensorConfiguration(const configuration::SensorConfiguration &sensorConfiguration)=0
Sets a sensor configuration to the device. It's virtual since it's implementation-specific.
bool hasImuAngularRateRange() const
Checks if the value of the imuAngularRateRange_ variable has been set by the user in the configuratio...