Replies: 3 comments 2 replies
-
Duplicate of #1122 |
Beta Was this translation helpful? Give feedback.
-
Migration Path?
namespace moveit {
struct State {
std::vector<double> variables;
};
State from_ik(Pose pose);
namespace core {
struct Kind;
Kind kind_from_string(std::string);
} // namspace core
} // namespace moveit namespace moveit {
State from_ik(Pose pose) {
auto k = core::kind_from_string("f1");
}
}
namespace moveit::core {
Kind kind_from_string(std::string);
} We could do this incrementally by first figuring out what the public interface of moveit::core should be and moving those things to just the moveit namespace. |
Beta Was this translation helpful? Give feedback.
-
Let's continue this discussion, especially in the light of great cleanup PR's like this. First off, I'd note that namespaces are not only there to prevent name collisions, but they really are labels that define groups of code in a certain context like a module. They define terminology and help with orientation in the codebase. Therefore, I think it would be sensible to define a single naming pattern that we can use for namespaces, file structure and even logger names. Then, if we want to flatten the namespace for our public API, I suggest that we provide a (single?) header file that defines this public API for convenience, and it should be use-case specific (MGI vs MoveItCpp). My concern is that if we remove the |
Beta Was this translation helpful? Give feedback.
-
Currently, in MoveIt there are many namespaces, some of which are nested. For example
moveit::core
,moveit_ros_control_interface
,moveit_servo
,moveit_cpp
,collision_detection
, etc.The whole point of namespaces is to prevent name collisions. The standard library mostly uses a single
stl
namespace. In the interest of making MoveIt code easier to read and easier to use, I suggest we migrate to a singlemoveit
namespace.@henningkayser, what are your thoughts on this?
Beta Was this translation helpful? Give feedback.
All reactions