Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port trajectory_rviz_plugin #201

Merged
merged 10 commits into from
Jun 22, 2020

Conversation

RoboticsYY
Copy link
Contributor

@RoboticsYY RoboticsYY commented May 26, 2020

Description

This PR intends to port the moveit_ros_visualization/trajectory_rviz_plugin to ROS2. The dependencies were ported previously in PR #160.

Checklist

@RoboticsYY RoboticsYY changed the title [WIP] Port trajectory_rviz_plugin Port trajectory_rviz_plugin Jun 3, 2020
Copy link
Contributor

@JafarAbdi JafarAbdi left a comment

Choose a reason for hiding this comment

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

I opened a PR to enable the trajectory visualization in the demo RoboticsYY#1

@@ -72,7 +74,7 @@ class TrajectoryDisplay : public rviz::Display
void onInitialize() override;
void onEnable() override;
void onDisable() override;
void setName(const QString& name) override;
// void setName(const QString& name) override;
Copy link
Contributor

Choose a reason for hiding this comment

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

This's set as final in display.hpp, so this should be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't figure out why Rviz2 made this method final. But I think removing this method will not affect the functionality of this plugin. Done remove.

@RoboticsYY
Copy link
Contributor Author

I opened a PR to enable the trajectory visualization in the demo RoboticsYY#1

@JafarAbdi Thanks for helping change the MoveItCpp demo!

@RoboticsYY RoboticsYY force-pushed the pr-trajectory_rviz_plugin branch 2 times, most recently from 72b2a8e to 9837670 Compare June 5, 2020 03:07
Copy link
Member

@henningkayser henningkayser left a comment

Choose a reason for hiding this comment

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

Looks great and works as intended. I've already based this on the sync without issues and will merge this after comments are addressed

@@ -145,6 +147,9 @@ void TrajectoryVisualization::onInitialize(const rclcpp::Node::SharedPtr& node,
context_ = context;
node_ = node;

auto ros_node_abstraction = context_->getRosNodeAbstraction().lock();
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to check if the weak_ptr lock was successful?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's better to make sure the lock() return non-empty pointer. A check has been added.

@@ -58,21 +58,23 @@ void TrajectoryDisplay::onInitialize()
{
Display::onInitialize();

trajectory_visual_->onInitialize(scene_node_, context_, update_nh_);
node_ = context_->getRosNodeAbstraction().lock()->get_raw_node();
Copy link
Member

Choose a reason for hiding this comment

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

same

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added check here as well.

@henningkayser henningkayser merged commit 17c51c9 into moveit:master Jun 22, 2020
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.

None yet

3 participants