Skip to content

Commit

Permalink
apply changes from review
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Weaver <[email protected]>
  • Loading branch information
tylerjw committed Dec 4, 2023
1 parent 26d0acd commit b5ad365
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
5 changes: 3 additions & 2 deletions moveit_core/exceptions/src/exceptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ namespace moveit

ConstructException::ConstructException(const std::string& what_arg) : std::runtime_error(what_arg)
{
RCLCPP_ERROR(getLogger("exception"), "Error during construction of object: %s\nException thrown.", what_arg.c_str());
RCLCPP_ERROR(getLogger("moveit_exception"), "Error during construction of object: %s\nException thrown.",
what_arg.c_str());
}

Exception::Exception(const std::string& what_arg) : std::runtime_error(what_arg)
{
RCLCPP_ERROR(getLogger("exception"), "%s\nException thrown.", what_arg.c_str());
RCLCPP_ERROR(getLogger("moveit_exception"), "%s\nException thrown.", what_arg.c_str());
}
} // namespace moveit
12 changes: 5 additions & 7 deletions moveit_core/robot_trajectory/test/test_robot_trajectory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ class RobotTrajectoryTestFixture : public testing::Test

void TearDown() override
{
robot_model_.reset();
robot_state_.reset();
}

void initTestTrajectory(robot_trajectory::RobotTrajectoryPtr& trajectory)
Expand Down Expand Up @@ -339,19 +337,19 @@ class OneRobot : public testing::Test

trajectory = std::make_shared<robot_trajectory::RobotTrajectory>(robot_model_, arm_jmg_name_);

ASSERT_EQ(trajectory->getGroupName(), arm_jmg_name_) << "Generated trajectory group name does not match";
ASSERT_TRUE(trajectory->empty()) << "Generated trajectory not empty";
EXPECT_EQ(trajectory->getGroupName(), arm_jmg_name_) << "Generated trajectory group name does not match";
EXPECT_TRUE(trajectory->empty()) << "Generated trajectory not empty";

double duration_from_previous = 0.1;
std::size_t waypoint_count = 5;
for (std::size_t ix = 0; ix < waypoint_count; ++ix)
trajectory->addSuffixWayPoint(*robot_state_, duration_from_previous);
// Quick check that getDuration is working correctly
ASSERT_EQ(trajectory->getDuration(), duration_from_previous * waypoint_count)
EXPECT_EQ(trajectory->getDuration(), duration_from_previous * waypoint_count)
<< "Generated trajectory duration incorrect";
ASSERT_EQ(waypoint_count, trajectory->getWayPointDurations().size())
EXPECT_EQ(waypoint_count, trajectory->getWayPointDurations().size())
<< "Generated trajectory has the wrong number of waypoints";
ASSERT_EQ(waypoint_count, trajectory->size());
EXPECT_EQ(waypoint_count, trajectory->size());
}

protected:
Expand Down

0 comments on commit b5ad365

Please sign in to comment.