Skip to content

Commit f8ae19f

Browse files
committed
Fix buffer order of acceleration and velocity
This was read in the reverse order from the script. Since the URScript functions use a first and then v, we should keep the buffer in the same order instead of switching the order we read from the stream.
1 parent 205cabd commit f8ae19f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/control/trajectory_point_interface.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,20 +78,20 @@ bool TrajectoryPointInterface::writeTrajectoryPoint(const vector6d_t* positions,
7878
}
7979
for (size_t i = 0; i < positions->size(); ++i)
8080
{
81-
int32_t val = static_cast<int32_t>(round(velocity * MULT_JOINTSTATE));
81+
int32_t val = static_cast<int32_t>(round(acceleration * MULT_JOINTSTATE));
8282
val = htobe32(val);
8383
b_pos += append(b_pos, val);
8484
}
8585
for (size_t i = 0; i < positions->size(); ++i)
8686
{
87-
int32_t val = static_cast<int32_t>(round(acceleration * MULT_JOINTSTATE));
87+
int32_t val = static_cast<int32_t>(round(velocity * MULT_JOINTSTATE));
8888
val = htobe32(val);
8989
b_pos += append(b_pos, val);
9090
}
9191
}
9292
else
9393
{
94-
b_pos += 6 * sizeof(int32_t);
94+
b_pos += 3 * 6 * sizeof(int32_t);
9595
}
9696

9797
int32_t val = static_cast<int32_t>(round(goal_time * MULT_TIME));

0 commit comments

Comments
 (0)