8#include <RobotsIO/Utils/SpatialVelocityYarpPort.h>
10#include <yarp/eigen/Eigen.h>
11#include <yarp/sig/Vector.h>
14using namespace RobotsIO::Utils;
15using namespace yarp::eigen;
16using namespace yarp::sig;
19SpatialVelocityYarpPort::SpatialVelocityYarpPort(
const std::string& port_name) :
24SpatialVelocityYarpPort:: ~SpatialVelocityYarpPort()
28bool SpatialVelocityYarpPort::freeze(
const bool blocking)
31 yarp::sig::Vector* velocity_yarp = receive_data(blocking);
32 if (velocity_yarp ==
nullptr)
37 auto now = std::chrono::steady_clock::now();
38 if (last_time_initialized_)
39 elapsed_time_ = std::chrono::duration_cast<std::chrono::milliseconds>(now - last_time_).count() / 1000.0;
41 last_time_initialized_ =
true;
43 twist_ = toEigen(*velocity_yarp);
48double SpatialVelocityYarpPort::elapsed_time()
54VectorXd SpatialVelocityYarpPort::twist()