Skip to content

Commit f9a7302

Browse files
committed
Add signal FeaturePosture::postureDot
1 parent 9bc2399 commit f9a7302

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

include/sot/core/feature-posture.hh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,11 @@ namespace dynamicgraph {
7979
virtual dg::Vector& computeError( dg::Vector& res, int );
8080
virtual dg::Matrix& computeJacobian( dg::Matrix& res, int );
8181
virtual dg::Vector& computeActivation( dg::Vector& res, int );
82+
virtual dg::Vector& computeErrorDot (dg::Vector& res,int time);
8283

8384
signalIn_t state_;
8485
signalIn_t posture_;
86+
signalIn_t postureDot_;
8587
signalOut_t error_;
8688
dg::Matrix jacobian_;
8789
private:

src/feature/feature-posture.cpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,12 @@ namespace dynamicgraph {
5353
: FeatureAbstract(name),
5454
state_(NULL, "FeaturePosture("+name+")::input(Vector)::state"),
5555
posture_(0, "FeaturePosture("+name+")::input(Vector)::posture"),
56+
postureDot_(0, "FeaturePosture("+name+")::input(Vector)::postureDot"),
5657
jacobian_(),
5758
activeDofs_ (),
5859
nbActiveDofs_ (0)
5960
{
60-
signalRegistration (state_ << posture_);
61+
signalRegistration (state_ << posture_ << postureDot_);
6162

6263
errorSOUT.addDependency (state_);
6364

@@ -116,6 +117,21 @@ namespace dynamicgraph {
116117
return res;
117118
}
118119

120+
dg::Vector& FeaturePosture::computeErrorDot( dg::Vector& res, int t)
121+
{
122+
const Vector& postureDot = postureDot_.access (t);
123+
124+
res.resize (nbActiveDofs_);
125+
std::size_t index=0;
126+
for (std::size_t i=0; i<activeDofs_.size (); ++i) {
127+
if (activeDofs_ [i]) {
128+
res (index) = postureDot (i);
129+
index ++;
130+
}
131+
}
132+
return res;
133+
}
134+
119135
void
120136
FeaturePosture::selectDof (unsigned dofId, bool control)
121137
{

0 commit comments

Comments
 (0)