diff --git a/include/humap_local_planner/humap_config.h b/include/humap_local_planner/humap_config.h index da6f887d..71a080d2 100644 --- a/include/humap_local_planner/humap_config.h +++ b/include/humap_local_planner/humap_config.h @@ -26,6 +26,8 @@ namespace humap_local_planner { struct GeneralParams { /// Whether to use planning (True) or proactive approach (False) for trajectory generation bool planning_approach = true; + /// How often the global path is expected to be updated + double path_planning_period = 0.5; /// The amount of time to roll trajectories out for in seconds double sim_time = 1.2; /// The granularity with which to check for collisions along each trajectory in meters diff --git a/src/humap_config_ros.cpp b/src/humap_config_ros.cpp index d4478891..7d5e5193 100644 --- a/src/humap_config_ros.cpp +++ b/src/humap_config_ros.cpp @@ -34,6 +34,18 @@ void HumapConfigROS::loadFromParamServer(const ros::NodeHandle& nh) { ); } + std::string planner_frequency_param; + nh.searchParam("planner_frequency", planner_frequency_param); + double planner_frequency = 2.0; + if (nh.param(planner_frequency_param, planner_frequency, planner_frequency)) { + general_->path_planning_period = 1.0 / planner_frequency; + ROS_INFO( + "Path planning period set to %6.3f s. Computed based on `planner_frequency` which is %6.3f Hz", + general_->path_planning_period, + planner_frequency + ); + } + // Limits // default values based on PAL's TIAGo config nh.param("max_vel_trans", limits_->max_vel_trans, 1.5);