RobotsIO
Loading...
Searching...
No Matches
SpatialVelocityBuffer.cpp
1/*
2 * Copyright (C) 2020 Istituto Italiano di Tecnologia (IIT)
3 *
4 * This software may be modified and distributed under the terms of the
5 * BSD 3-Clause license. See the accompanying LICENSE file for details.
6 */
7
8#include <RobotsIO/Utils/SpatialVelocityBuffer.h>
9
10using namespace Eigen;
11using namespace RobotsIO::Utils;
12
13
14SpatialVelocityBuffer::SpatialVelocityBuffer()
15{
16 twist_.resize(6);
17}
18
19SpatialVelocityBuffer::~SpatialVelocityBuffer()
20{}
21
22
23bool SpatialVelocityBuffer::freeze(const bool blocking)
24{
25 return true;
26}
27
28
29void SpatialVelocityBuffer::set_twist(const Eigen::Vector3d& linear_velocity, const Eigen::Vector3d& angular_velocity, const double& elapsed_time)
30{
31 twist_.head<3>() = linear_velocity;
32 twist_.segment<3>(3) = angular_velocity;
33 elapsed_time_ = elapsed_time;
34}
35
36
37double SpatialVelocityBuffer::elapsed_time()
38{
39 return elapsed_time_;
40}
41
42
43Eigen::VectorXd SpatialVelocityBuffer::twist()
44{
45 return twist_;
46}