Skip to content

Commit

Permalink
actuators: use generic field names (#11)
Browse files Browse the repository at this point in the history
companion to ign-msgs pr# 129
  • Loading branch information
scpeters authored May 11, 2019
1 parent 4457dc6 commit f2bfc63
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions src/convert_builtin_interfaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,9 @@ convert_1_to_ign(
convert_1_to_ign(ros1_msg.header, (*ign_msg.mutable_header()));

for (auto i = 0u; i < ros1_msg.angles.size(); ++i)
ign_msg.add_angle(ros1_msg.angles[i]);
ign_msg.add_position(ros1_msg.angles[i]);
for (auto i = 0u; i < ros1_msg.angular_velocities.size(); ++i)
ign_msg.add_angular_velocity(ros1_msg.angular_velocities[i]);
ign_msg.add_velocity(ros1_msg.angular_velocities[i]);
for (auto i = 0u; i < ros1_msg.normalized.size(); ++i)
ign_msg.add_normalized(ros1_msg.normalized[i]);
}
Expand All @@ -307,10 +307,10 @@ convert_ign_to_1(
{
convert_ign_to_1(ign_msg.header(), ros1_msg.header);

for (auto i = 0; i < ign_msg.angle_size(); ++i)
ros1_msg.angles.push_back(ign_msg.angle(i));
for (auto i = 0; i < ign_msg.angular_velocity_size(); ++i)
ros1_msg.angular_velocities.push_back(ign_msg.angular_velocity(i));
for (auto i = 0; i < ign_msg.position_size(); ++i)
ros1_msg.angles.push_back(ign_msg.position(i));
for (auto i = 0; i < ign_msg.velocity_size(); ++i)
ros1_msg.angular_velocities.push_back(ign_msg.velocity(i));
for (auto i = 0; i < ign_msg.normalized_size(); ++i)
ros1_msg.normalized.push_back(ign_msg.normalized(i));
}
Expand Down
10 changes: 5 additions & 5 deletions test/test_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -922,8 +922,8 @@ namespace testing

for (int i = 0u; i < 5; ++i)
{
_msg.add_angle(i);
_msg.add_angular_velocity(i);
_msg.add_position(i);
_msg.add_velocity(i);
_msg.add_normalized(i);
}
}
Expand All @@ -937,10 +937,10 @@ namespace testing

compareTestMsg(_msg.header());

for (int i = 0; i < expected_msg.angle_size(); ++i)
for (int i = 0; i < expected_msg.position_size(); ++i)
{
EXPECT_EQ(expected_msg.angle(i), _msg.angle(i));
EXPECT_EQ(expected_msg.angular_velocity(i), _msg.angular_velocity(i));
EXPECT_EQ(expected_msg.position(i), _msg.position(i));
EXPECT_EQ(expected_msg.velocity(i), _msg.velocity(i));
EXPECT_EQ(expected_msg.normalized(i), _msg.normalized(i));
}
}
Expand Down

0 comments on commit f2bfc63

Please sign in to comment.