Skip to content

Graphically print current robot joint states with joint limits - #1358

Merged
davetcoleman merged 1 commit into
moveit:melodic-develfrom
davetcoleman:melodic-print-joint-limits
Feb 25, 2019
Merged

davetcoleman merged 1 commit into
moveit:melodic-develfrom
davetcoleman:melodic-print-joint-limits

Conversation

@davetcoleman

Copy link
Copy Markdown
Member

A trivial feature I made a long time ago, with unit tests

image

@rhaschke rhaschke left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor remarks only.
By the way, the code doesn't handle unbounded joints yet, does it?

{
moveit::core::RobotState state(robot_model_);
const robot_model::JointModelGroup* joint_model_group = robot_model_->getJointModelGroup("base_from_base_to_e");
EXPECT_TRUE(joint_model_group);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
EXPECT_TRUE(joint_model_group);
ASSERT_TRUE(joint_model_group);

out << nm[i] << "=" << position_[i] << std::endl;
}

bool RobotState::printStatePositionsWithJointLimits(const moveit::core::JointModelGroup* jmg, std::ostream& out) const

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the motivation behind the return value in this print function?
The function is always returning true. Please change to returning void.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it used to return false when there were multi-variable joints, but i removed that. fixed per you

@davetcoleman
davetcoleman force-pushed the melodic-print-joint-limits branch from fc3a657 to 8938af8 Compare February 24, 2019 21:37
void RobotState::printStatePositionsWithJointLimits(const moveit::core::JointModelGroup* jmg, std::ostream& out) const
{
// TODO(davetcoleman): support joints with multiple variables / multiple DOFs such as floating joints
// TODO(davetcoleman): support unbounded joints

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's an interesting solution to reply to change requests 😉

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think its a very good solution myself! don't build it until you need it...

@davetcoleman
davetcoleman merged commit 6a9f0ea into moveit:melodic-devel Feb 25, 2019
@davetcoleman
davetcoleman deleted the melodic-print-joint-limits branch February 25, 2019 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants