Skip to content

Commit

Permalink
Changed delimiter, removed entity types from name, minor cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Aditya <[email protected]>
  • Loading branch information
adityapande-1995 committed Feb 22, 2022
1 parent 04e0439 commit b683fe7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/systems/physics/Physics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3260,10 +3260,10 @@ void PhysicsPrivate::UpdateCollisions(EntityComponentManager &_ecm)
msgs::Contact *contactMsg = contactsComp.add_contact();
contactMsg->mutable_collision1()->set_id(_collEntity1);
contactMsg->mutable_collision1()->set_name(
scopedName(_collEntity1, _ecm, ":", 1));
removeParentScope(scopedName(_collEntity1, _ecm, "::", 0), "::"));
contactMsg->mutable_collision2()->set_id(collEntity2);
contactMsg->mutable_collision2()->set_name(
scopedName(collEntity2, _ecm, ":", 1));
removeParentScope(scopedName(collEntity2, _ecm, "::", 0), "::"));
for (const auto &contact : contactData)
{
auto *position = contactMsg->add_position();
Expand Down
10 changes: 5 additions & 5 deletions test/integration/contact_system.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ TEST_F(ContactSystemTest,
EXPECT_NEAR(0.25, std::abs(contact.position(0).x()), 5e-2);
EXPECT_NEAR(1, std::abs(contact.position(0).y()), 5e-2);
EXPECT_NEAR(1, contact.position(0).z(), 5e-2);
bool EntityNameFound =
bool entityNameFound =
contact.collision1().name() ==
"world:contact_sensor:model:contact_model:link:link:collision:collision_sphere1" ||
contact.collision1().name() ==
"world:contact_sensor:model:contact_model:link:link:collision:collision_sphere2";
EXPECT_TRUE(EntityNameFound);
"contact_model::link::collision_sphere1" ||
contact.collision1().name() ==
"contact_model::link::collision_sphere2";
EXPECT_TRUE(entityNameFound);
}
}

Expand Down

0 comments on commit b683fe7

Please sign in to comment.