0
$\begingroup$

Rosanswers logo

I was reading the code of a file in the tutorial of MoveIt Ros melodic and I saw this namespace rvt = rviz_visual_tools;

and it doesn't make sense for me, someone want to explain to me that

note: code line 82

https://github.com/ros-planning/moveit_tutorials/blob/melodic-devel/doc/move_group_interface/src/move_group_interface_tutorial.cpp


Originally posted by RDLUIS on ROS Answers with karma: 1 on 2021-01-10

Post score: 0


Original comments

Comment by RDLUIS on 2021-01-12:
that line code is in line 82

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

It's just so you can type rvt::whatever() instead of rviz_visual_tools::whatever() without losing some connection to the fact that whatever() comes from rviz_visual_tools(and avoiding name collisions which I'd guess is likely here with the MoveIt visual tools, but I'd have to dig in the code to be sure.)

You know here for example that WHITE and LARGE come from rviz_visual_tools which otherwise would be hard to know at a glance at that line.

With the namespace alias, it's easy to see.


Originally posted by qTHqq with karma: 26 on 2021-01-12

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by RDLUIS on 2021-01-13:
thank you very much you're the best

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.