Skip to content

Commit 4045190

Browse files
Merge branch 'main' into fix/collision-monitoring-attached-objects-not-updating
2 parents 1c88000 + 7db0bd4 commit 4045190

File tree

2 files changed

+23
-22
lines changed

2 files changed

+23
-22
lines changed

moveit_ros/moveit_servo/src/servo_node.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ void ServoNode::servoLoop()
398398
else
399399
{
400400
// if no new command was created, use current robot state
401+
last_commanded_state_ = current_state = servo_->getCurrentRobotState(false);
401402
updateSlidingWindow(current_state, joint_cmd_rolling_window_, servo_params_.max_expected_latency, cur_time);
402403
servo_->resetSmoothing(current_state);
403404
}

moveit_ros/planning/trajectory_execution_manager/src/trajectory_execution_manager.cpp

+22-22
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,6 @@ void TrajectoryExecutionManager::initialize()
106106
allowed_execution_duration_scaling_ = DEFAULT_CONTROLLER_GOAL_DURATION_SCALING;
107107
allowed_goal_duration_margin_ = DEFAULT_CONTROLLER_GOAL_DURATION_MARGIN;
108108

109-
// load controller-specific values for allowed_execution_duration_scaling and allowed_goal_duration_margin
110-
loadControllerParams();
111-
112109
// load the controller manager plugin
113110
try
114111
{
@@ -191,6 +188,10 @@ void TrajectoryExecutionManager::initialize()
191188

192189
// other configuration steps
193190
reloadControllerInformation();
191+
192+
// load controller-specific values for allowed_execution_duration_scaling and allowed_goal_duration_margin
193+
loadControllerParams();
194+
194195
// The default callback group for rclcpp::Node is MutuallyExclusive which means we cannot call
195196
// receiveEvent while processing a different callback. To fix this we create a new callback group (the type is not
196197
// important since we only use it to process one callback) and associate event_topic_subscriber_ with this callback group
@@ -1841,25 +1842,24 @@ bool TrajectoryExecutionManager::ensureActiveControllers(const std::vector<std::
18411842

18421843
void TrajectoryExecutionManager::loadControllerParams()
18431844
{
1844-
// TODO: Revise XmlRpc parameter lookup
1845-
// XmlRpc::XmlRpcValue controller_list;
1846-
// if (node_->get_parameter("controller_list", controller_list) &&
1847-
// controller_list.getType() == XmlRpc::XmlRpcValue::TypeArray)
1848-
// {
1849-
// for (int i = 0; i < controller_list.size(); ++i) // NOLINT(modernize-loop-convert)
1850-
// {
1851-
// XmlRpc::XmlRpcValue& controller = controller_list[i];
1852-
// if (controller.hasMember("name"))
1853-
// {
1854-
// if (controller.hasMember("allowed_execution_duration_scaling"))
1855-
// controller_allowed_execution_duration_scaling_[std::string(controller["name"])] =
1856-
// controller["allowed_execution_duration_scaling"];
1857-
// if (controller.hasMember("allowed_goal_duration_margin"))
1858-
// controller_allowed_goal_duration_margin_[std::string(controller["name"])] =
1859-
// controller["allowed_goal_duration_margin"];
1860-
// }
1861-
// }
1862-
// }
1845+
for (const auto& controller : known_controllers_)
1846+
{
1847+
const std::string& controller_name = controller.first;
1848+
for (const auto& controller_manager_name : controller_manager_loader_->getDeclaredClasses())
1849+
{
1850+
const std::string parameter_prefix =
1851+
controller_manager_loader_->getClassPackage(controller_manager_name) + "." + controller_name;
1852+
1853+
double allowed_execution_duration_scaling;
1854+
if (node_->get_parameter(parameter_prefix + ".allowed_execution_duration_scaling",
1855+
allowed_execution_duration_scaling))
1856+
controller_allowed_execution_duration_scaling_.insert({ controller_name, allowed_execution_duration_scaling });
1857+
1858+
double allowed_goal_duration_margin;
1859+
if (node_->get_parameter(parameter_prefix + ".allowed_goal_duration_margin", allowed_goal_duration_margin))
1860+
controller_allowed_goal_duration_margin_.insert({ controller_name, allowed_goal_duration_margin });
1861+
}
1862+
}
18631863
}
18641864

18651865
double TrajectoryExecutionManager::getAllowedStartToleranceJoint(const std::string& joint_name) const

0 commit comments

Comments
 (0)