Skip to content

Commit 451c95f

Browse files
mikelikesrobotsmergify[bot]
authored andcommitted
Correct interpolation to use both points (#794)
(cherry picked from commit 7c29502)
1 parent 9e8ca55 commit 451c95f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

example_7/controller/r6bot_controller.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,12 @@ void interpolate_point(
125125
{
126126
for (size_t i = 0; i < point_1.positions.size(); i++)
127127
{
128-
point_interp.positions[i] = delta * point_2.positions[i] + (1.0 - delta) * point_2.positions[i];
128+
point_interp.positions[i] = delta * point_2.positions[i] + (1.0 - delta) * point_1.positions[i];
129129
}
130130
for (size_t i = 0; i < point_1.positions.size(); i++)
131131
{
132132
point_interp.velocities[i] =
133-
delta * point_2.velocities[i] + (1.0 - delta) * point_2.velocities[i];
133+
delta * point_2.velocities[i] + (1.0 - delta) * point_1.velocities[i];
134134
}
135135
}
136136

0 commit comments

Comments
 (0)