Skip to content

Commit

Permalink
Update joint_state_controller.cpp: clear joint_state_ before assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
onionsflying authored and bmagyar committed Aug 29, 2023
1 parent dce8785 commit 495fb97
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions joint_state_controller/src/joint_state_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ namespace joint_state_controller
realtime_pub_.reset(new realtime_tools::RealtimePublisher<sensor_msgs::JointState>(root_nh, "joint_states", 4));

// get joints and allocate message
joint_state_.clear();
for (unsigned i=0; i<num_hw_joints_; i++){
joint_state_.push_back(hw->getHandle(joint_names[i]));
realtime_pub_->msg_.name.push_back(joint_names[i]);
Expand Down

0 comments on commit 495fb97

Please sign in to comment.