Go to the documentation of this file.
6 #include <rokubimini_msgs/FirmwareUpdateSerial.h>
7 #include <rokubimini_msgs/ResetWrench.h>
8 #include <geometry_msgs/Wrench.h>
10 #include <Eigen/Dense>
391 rokubimini_msgs::FirmwareUpdateSerial::Response& response);
404 rokubimini_msgs::ResetWrench::Response& response);
bool setForceTorqueFilter(const configuration::ForceTorqueFilter &filter) override
Sets a force torque filter to the device.
void publishConnectionStatusDiagnostics()
Publishes the Connection Status Diagnostics to the "/diagnostics" topic.
bool loadConfig()
Loads the configuration of the device.
void createRosPublishers() override
Adds ROS publishers related to the device.
bool resetWrenchCallback(rokubimini_msgs::ResetWrench::Request &request, rokubimini_msgs::ResetWrench::Response &response)
The callback for the reset wrench ROS service.
void publishRosDiagnostics() override
Publish ROS diagnostics related to the operation of rokubimini.
RokubiminiSerialImplPtr implPtr_
The pointer to implementation.
RokubiminiSerial()=default
Default constructor.
bool deviceIsMissing() const override
Checks if the device is missing.
void updateProcessReading() override
Updates the RokubiminiSerial object with new measurements.
bool init()
Initializes communication with a Rokubimini Serial device.
RosPublisherPtr wrenchPublisher_
The sensor_msgs::Wrench publisher.
bool setAngularRateFilter(const unsigned int filter) override
Sets an angular rate filter to the device.
void createRosDiagnostics() override
Adds ROS diagnostics related to the operation of rokubimini.
std::thread publishingThread_
The thread that publishes the sensor messages to ROS.
bool publishersSet_
Flag to check whether publishers are ready.
Eigen::Matrix< double, 6, Eigen::Dynamic > resetServiceWrenchSamples_
The wrench samples used by the "reset service" callback for calculating the mean wrench offset.
bool setAccelerationRange(const unsigned int range) override
Sets an acceleration range to the device.
bool setSensorCalibration(const calibration::SensorCalibration &sensorCalibration) override
Sets a sensor calibration to the device.
bool setConfigMode()
Sets the device in config mode.
void postSetupConfiguration() override
Post-setup configuration hook.
std::atomic< bool > computeMeanWrenchFlag_
The flag for enabling the computation of the mean of the wrench measurements. Used withing the "reset...
void shutdownWithCommunication() override
Shuts down a Rokubimini Serial device before communication has been closed.
~RokubiminiSerial() override=default
ros::ServiceServer resetWrenchService_
The service for resetting the sensor wrench measurements.
The Rokubimini Serial class.
void signalShutdown()
Signals shutdown for the ROS node. It's used if a firmware update was successful.
void publishRosMessages() override
Publishes ROS messages with data from the rokubimini device.
bool rosDiagnosticsSet_
Flag to check whether ros diagnostics are ready.
bool setRunMode()
Sets the device in run mode.
bool firmwareUpdateCallback(rokubimini_msgs::FirmwareUpdateSerial::Request &request, rokubimini_msgs::FirmwareUpdateSerial::Response &response)
The callback for the firmware update ROS service.
bool setPublishMode(double timeStep)
Sets the publishing mode (synchronous or async) of the serial device.
void preSetupConfiguration() override
Post-setup configuration hook.
void update()
Updates the internal Reading with new measurements and publishes them to ROS.
bool setForceTorqueOffset(const Eigen::Matrix< double, 6, 1 > &forceTorqueOffset) override
Sets a force torque offset to the device.
bool getSerialNumber(unsigned int &serialNumber) override
Gets the serial number of the device.
std::shared_ptr< ros::Publisher > RosPublisherPtr
RosPublisherPtr temperaturePublisher_
The sensor_msgs::Temperature publisher.
bool saveConfigParameter() override
Saves the current configuration to the device.
bool setAngularRateRange(const unsigned int range) override
Sets an angular rate range to the device.
bool setAccelerationFilter(const unsigned int filter) override
Sets an acceleration filter to the device.
void setImplPointer(const RokubiminiSerialImplPtr &implPtr)
Sets a pointer to the implementation.
uint64_t noFrameSyncCounter_
The counter for measuring failed frame synchronizations.
void updateConnectionStatus(diagnostic_updater::DiagnosticStatusWrapper &stat)
Updates the Connection Status of the device and adds it to the diagnostics status.
RosPublisherPtr readingPublisher_
The rokubimini_msgs::Reading publisher.
bool printUserConfig()
Prints all the user configurable parameters.
std::shared_ptr< RokubiminiSerialImpl > RokubiminiSerialImplPtr
RokubiminiSerial(const std::string &name, NodeHandlePtr nh)
void createRosServices() override
Adds ROS services related to the device.
void publishDataFlagsDiagnostics(const ros::TimerEvent &event)
Publishes the Data Flags Diagnostics to the "/diagnostics" topic.
void parseCommunicationMsgs()
Parses the incoming communication msgs from the device.
bool getForceTorqueSamplingRate(int &samplingRate) override
Gets the force torque sampling rate of the device.
const static uint32_t TOTAL_NUMBER_OF_WRENCH_MESSAGES
std::shared_ptr< ros::NodeHandle > NodeHandlePtr
std::recursive_mutex meanWrenchOffsetMutex_
The mutex for accessing the mean of the wrench measurements. Used for the "reset service" callback.
bool setInitMode()
Triggers a software reset of the sensor bringing it to a known state.
bool setSensorConfiguration(const configuration::SensorConfiguration &sensorConfiguration) override
Sets a sensor configuration to the device.
std::atomic< uint32_t > wrenchMessageCount_
The counter that is used for the computation of the mean of the wrench measurements....
bool setHardwareReset()
Triggers a hardware reset of the sensor.
ros::ServiceServer firmwareUpdateService_
The service for firmware updates.