ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

namespace name= other name

asked 2021-01-10 20:45:53 -0500

RDLUIS gravatar image

updated 2021-01-12 12:49:00 -0500

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/movei...

edit retag flag offensive close merge delete

Comments

that line code is in line 82

RDLUIS gravatar image RDLUIS  ( 2021-01-12 12:51:58 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-01-12 17:10:11 -0500

qTHqq gravatar image

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.

edit flag offensive delete link more

Comments

thank you very much you're the best

RDLUIS gravatar image RDLUIS  ( 2021-01-13 17:27:18 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2021-01-10 20:45:53 -0500

Seen: 135 times

Last updated: Jan 12 '21