File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
joint_trajectory_controller/src Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -769,6 +769,10 @@ controller_interface::CallbackReturn JointTrajectoryController::on_configure(
769
769
// Check if only allowed interface types are used and initialize storage to avoid memory
770
770
// allocation during activation
771
771
joint_command_interface_.resize (allowed_interface_types_.size ());
772
+ for (auto & itf : joint_command_interface_)
773
+ {
774
+ itf.reserve (params_.joints .size ());
775
+ }
772
776
773
777
has_position_command_interface_ =
774
778
contains_interface_type (params_.command_interfaces , hardware_interface::HW_IF_POSITION);
@@ -806,6 +810,10 @@ controller_interface::CallbackReturn JointTrajectoryController::on_configure(
806
810
// allocation during activation
807
811
// Note: 'effort' storage is also here, but never used. Still, for this is OK.
808
812
joint_state_interface_.resize (allowed_interface_types_.size ());
813
+ for (auto & itf : joint_state_interface_)
814
+ {
815
+ itf.reserve (params_.joints .size ());
816
+ }
809
817
810
818
has_position_state_interface_ =
811
819
contains_interface_type (params_.state_interfaces , hardware_interface::HW_IF_POSITION);
You can’t perform that action at this time.
0 commit comments