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

restructure C++ namespaces #1122

Open
v4hn opened this issue Mar 15, 2022 · 1 comment
Open

restructure C++ namespaces #1122

v4hn opened this issue Mar 15, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@v4hn
Copy link
Contributor

v4hn commented Mar 15, 2022

We have quite a lot of namespaces in our code bases. I'm not saying this is bad, but we could definitely rethink some of them and adapt them to make more sense.

The main question is whether we want to have a moveit namespace for everything. We do not at the moment, but I would definitely support it.
Instead we have a moveit::core namespace for the Joint/LinkModel, RobotModel and RobotState classes, but a planning_scene namespace for the PlanningScene (which is arguably as much core as the prior classes).

The PlanningSceneMonitor (the core structure to maintain a scene) is in planning_scene_monitor, together with CurrentStateMonitor, LockedPlanningSceneRO/RW and the TrajectoryMonitor. I would argue that moveit::monitor:: might be a better term here (and whether LockedPlanningScene* should even exist is a different matter).

These are just some examples, the following grep gives a rather good insight into the current mess:

❯ grep -rh '^namespace' | sort -u
namespace
namespace AllowedCollision
namespace BodyTypes
namespace boost
namespace bp = boost::python;
namespace cached_ik_kinematics_plugin
namespace cb = collision_detection_bullet;
namespace chomp
namespace chomp_interface
namespace collision_detection
namespace collision_detection_bullet
namespace constraint_sampler_manager_loader
namespace constraint_samplers
namespace converter
namespace core
namespace default_planner_request_adapters
namespace detail
namespace details
namespace DiscretizationMethods
namespace displays
namespace distance_field
namespace DistanceRequestTypes
namespace dynamics_solver
namespace EigenSTL
namespace enc = sensor_msgs::image_encodings;
namespace fcl
namespace fs = boost::filesystem;
namespace ikfast
namespace IKFAST_NAMESPACE
namespace IKFAST_NAMESPACE {
namespace InteractionStyle
namespace interactive_markers
namespace joint_limits
namespace joint_limits_interface
namespace KDL
namespace kdl_kinematics_plugin
namespace kinematic_constraints
namespace KinematicErrors
namespace kinematics
namespace kinematics_cache
namespace kinematics_cache_ros
namespace kinematics_constraint_aware
namespace kinematics_metrics
namespace kinematics_plugin_loader
namespace lma_kinematics_plugin
namespace mesh_filter
namespace mesh_filter_test
namespace move_group
namespace moveit
namespace moveit_benchmarks
namespace moveit_controller_manager
namespace moveit_controller_manager_example
namespace moveit_cpp
namespace moveit_fake_controller_manager
namespace moveit::hybrid_planning
namespace moveit_hybrid_planning
namespace moveit_ros_benchmarks
namespace moveit_ros_control_interface
namespace moveit_rviz_plugin
namespace moveit_sensor_manager
namespace moveit_servo
namespace moveit_setup_assistant
namespace moveit_simple_controller_manager
namespace moveit_warehouse
namespace mpi = moveit::planning_interface;
namespace names
namespace _NAMESPACE_
namespace ob = ompl::base;
namespace occupancy_map_monitor
namespace octomap
namespace og = ompl::geometric;
namespace Ogre
namespace ompl_interface
namespace ompl_interface_testing
namespace online_signal_smoothing
namespace ot = ompl::tools;
namespace pick_place
namespace pilz_extensions_tests
namespace pilz_industrial_motion_planner
namespace pilz_industrial_motion_planner_testutils
namespace plan_execution
namespace planning_interface
namespace planning_pipeline
namespace planning_request_adapter
namespace planning_scene
namespace planning_scene_monitor
namespace po = boost::program_options;
namespace point_containment_filter
namespace pr2_arm_kinematics
namespace prbt_manipulator
namespace properties
namespace pt = boost::property_tree;
namespace pybind11
namespace py_bindings_tools
namespace py = pybind11;
namespace python
namespace rclcpp
namespace rdf_loader
namespace robot
namespace robot_interaction
namespace robot_model_loader
namespace robot_trajectory
namespace rviz
namespace rviz_common
namespace rviz_default_plugins
namespace rviz_rendering
namespace sbpl_interface
namespace sbpl_interface
namespace sbpl_interface_ros
namespace semantic_world
namespace shapes
namespace srv_kinematics_plugin
namespace testing
namespace test_moveit_controller_manager
namespace testutils
namespace tf2_ros
namespace tools
namespace trajectory_execution_manager
namespace trajectory_processing
namespace trajopt_interface
namespace Ui
namespace util
namespace XmlRpc
@v4hn v4hn added the enhancement New feature or request label Mar 15, 2022
@henningkayser
Copy link
Member

phew, now you are opening a can of worms. "Yes" to introducing moveit as a general namespace. We could definitely do some cleanup here looking at the grepped list. I like the idea of grouping the monitors, but then we could maybe just go with moveit::ros to indicate that these are ros runtime components. moveit::ros::interface could then include the client interface parts (somewhat long, though). Likewise, I think it wouldn't be a bad idea to group plugins in moveit::plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants