Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bodydynamics
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mobile_robotics
wolf_projects
wolf_lib
plugins
bodydynamics
Commits
1e0ae19e
Commit
1e0ae19e
authored
2 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Patches
Plain Diff
Use state derived
parent
a6c8556d
No related branches found
No related tags found
3 merge requests
!31
devel->main
,
!29
Add functionality for UAV
,
!27
Fix test with acc_x = 2 m/s2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/sensor/sensor_force_torque_inertial.cpp
+11
-10
11 additions, 10 deletions
src/sensor/sensor_force_torque_inertial.cpp
test/gtest_factor_force_torque_inertial.cpp
+5
-0
5 additions, 0 deletions
test/gtest_factor_force_torque_inertial.cpp
with
16 additions
and
10 deletions
src/sensor/sensor_force_torque_inertial.cpp
+
11
−
10
View file @
1e0ae19e
...
...
@@ -23,6 +23,7 @@
#include
"bodydynamics/sensor/sensor_force_torque_inertial.h"
#include
<core/state_block/factory_state_block.h>
#include
<core/state_block/state_block_derived.h>
namespace
wolf
{
...
...
@@ -31,36 +32,36 @@ namespace wolf
SensorForceTorqueInertial
::
SensorForceTorqueInertial
(
const
VectorXd
&
_extrinsics
,
ParamsSensorForceTorqueInertialPtr
_params
)
:
SensorBase
(
"SensorForceTorqueInertial"
,
FactoryStateBlock
::
create
(
"State
Block
"
,
_extrinsics
.
head
(
3
),
false
),
FactoryStateBlock
::
create
(
"State
Point3d
"
,
_extrinsics
.
head
(
3
),
false
),
FactoryStateBlock
::
create
(
"StateQuaternion"
,
_extrinsics
.
tail
(
4
),
false
),
FactoryStateBlock
::
create
(
"State
Block
"
,
Vector6d
::
Zero
(),
false
),
// IMU bias
FactoryStateBlock
::
create
(
"State
Params6
"
,
Vector6d
::
Zero
(),
false
),
// IMU bias
12
,
false
,
false
,
false
),
params_fti_
(
_params
)
{
addStateBlock
(
'c'
,
FactoryStateBlock
::
create
(
"State
Block
"
,
Vector3d
::
Ones
(),
true
));
// centre of mass
addStateBlock
(
'i'
,
FactoryStateBlock
::
create
(
"State
Block
"
,
Vector3d
::
Ones
(),
true
));
// inertial vector
addStateBlock
(
'm'
,
FactoryStateBlock
::
create
(
"State
Block
"
,
Vector1d
::
Ones
(),
true
));
// total mass
addStateBlock
(
'c'
,
FactoryStateBlock
::
create
(
"State
Params3
"
,
Vector3d
::
Ones
(),
true
));
// centre of mass
addStateBlock
(
'i'
,
FactoryStateBlock
::
create
(
"State
Params3
"
,
Vector3d
::
Ones
(),
true
));
// inertial vector
addStateBlock
(
'm'
,
FactoryStateBlock
::
create
(
"State
Params1
"
,
Vector1d
::
Ones
(),
true
));
// total mass
}
// TODO: Adapt this API to that of MR !448
SensorForceTorqueInertial
::
SensorForceTorqueInertial
(
const
VectorComposite
&
_states
,
ParamsSensorForceTorqueInertialPtr
_params
)
:
SensorBase
(
"SensorForceTorqueInertial"
,
FactoryStateBlock
::
create
(
"State
Block
"
,
_states
.
at
(
'P'
),
false
),
FactoryStateBlock
::
create
(
"State
Point3d
"
,
_states
.
at
(
'P'
),
false
),
FactoryStateBlock
::
create
(
"StateQuaternion"
,
_states
.
at
(
'O'
),
false
),
FactoryStateBlock
::
create
(
"State
Block
"
,
_states
.
at
(
'I'
),
false
),
// IMU bias
FactoryStateBlock
::
create
(
"State
Params6
"
,
_states
.
at
(
'I'
),
false
),
// IMU bias
12
,
false
,
false
,
false
),
params_fti_
(
_params
)
{
emplaceStateBlock
(
'c'
,
getProblem
(),
_states
.
at
(
'c'
),
true
);
// centre of mass
emplaceStateBlock
(
'i'
,
getProblem
(),
_states
.
at
(
'i'
),
true
);
// inertial vector
emplaceStateBlock
(
'm'
,
getProblem
(),
_states
.
at
(
'm'
),
true
);
// total mass
auto
sbc
=
emplaceStateBlock
<
StateParams3
>
(
'c'
,
getProblem
(),
_states
.
at
(
'c'
),
true
);
// centre of mass
auto
sbi
=
emplaceStateBlock
<
StateParams3
>
(
'i'
,
getProblem
(),
_states
.
at
(
'i'
),
true
);
// inertial vector
auto
sbm
=
emplaceStateBlock
<
StateParams1
>
(
'm'
,
getProblem
(),
_states
.
at
(
'm'
),
true
);
// total mass
setStateBlockDynamic
(
'c'
,
false
);
setStateBlockDynamic
(
'i'
,
false
);
setStateBlockDynamic
(
'm'
,
false
);
...
...
This diff is collapsed.
Click to expand it.
test/gtest_factor_force_torque_inertial.cpp
+
5
−
0
View file @
1e0ae19e
...
...
@@ -36,6 +36,11 @@
using
namespace
wolf
;
using
namespace
bodydynamics
::
fti
;
// Register StateBlock of type "L"
#include
<core/state_block/state_block_derived.h>
#include
<core/state_block/factory_state_block.h>
WOLF_REGISTER_STATEBLOCK_WITH_KEY
(
L
,
StateVector3d
);
class
Test_FactorForceTorqueInertialPreint
:
public
testing
::
Test
{
public:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment