Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
sot-torque-control
Commits
91bcc324
Commit
91bcc324
authored
Apr 16, 2019
by
Olivier Stasse
Browse files
[causual-filter] Propagates changes to src file.
parent
3b788f60
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/causal-filter.cpp
View file @
91bcc324
...
...
@@ -83,7 +83,7 @@ void CausalFilter::get_x_dx_ddx(const Eigen::VectorXd& base_x,
x_output_dx_ddx
.
head
(
m_x_size
)
=
(
input_buffer
*
b
-
output_buffer
*
a
)
/
m_filter_denominator
[
0
];
//Finite Difference
Eigen
::
Index
pt_denominator_prev
=
(
pt_denominator
==
0
)
?
m_filter_order_n
-
2
:
pt_denominator
-
1
;
Eigen
::
VectorXd
::
Index
pt_denominator_prev
=
(
pt_denominator
==
0
)
?
m_filter_order_n
-
2
:
pt_denominator
-
1
;
x_output_dx_ddx
.
segment
(
m_x_size
,
m_x_size
)
=
(
x_output_dx_ddx
.
head
(
m_x_size
)
-
output_buffer
.
col
(
pt_denominator
))
/
m_dt
;
x_output_dx_ddx
.
tail
(
m_x_size
)
=
(
x_output_dx_ddx
.
head
(
m_x_size
)
-
2
*
output_buffer
.
col
(
pt_denominator
)
+
output_buffer
.
col
(
pt_denominator_prev
))
/
m_dt
/
m_dt
;
...
...
@@ -98,8 +98,8 @@ void CausalFilter::get_x_dx_ddx(const Eigen::VectorXd& base_x,
void
CausalFilter
::
switch_filter
(
const
Eigen
::
VectorXd
&
filter_numerator
,
const
Eigen
::
VectorXd
&
filter_denominator
)
{
Eigen
::
Index
filter_order_m
=
filter_numerator
.
size
();
Eigen
::
Index
filter_order_n
=
filter_denominator
.
size
();
Eigen
::
VectorXd
::
Index
filter_order_m
=
filter_numerator
.
size
();
Eigen
::
VectorXd
::
Index
filter_order_n
=
filter_denominator
.
size
();
Eigen
::
VectorXd
current_x
(
input_buffer
.
col
(
pt_numerator
));
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment