Skip to content

Commit

Permalink
Merge pull request #73 from TAMS-Group/pr-kinetic-add-ft-frame
Browse files Browse the repository at this point in the history
add frame_id to f/t wrench messages
  • Loading branch information
k-okada committed Feb 12, 2019
2 parents 825f997 + dd61ecb commit de67121
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ethercat_hardware/src/wg06.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,9 @@ bool WG06::unpackFT(WG06StatusWithAccelAndFT *status, WG06StatusWithAccelAndFT *
// Make room in data structure for more f/t samples
ft_state.samples_.resize(usable_samples);

// add side "l" or "r" to frame_id
string ft_link_id = string(actuator_info_.name_).substr(0,1) + "_force_torque_link";

// If any f/t channel is overload or the sampling rate is bad, there is an error.
ft_state.good_ = ( (!ft_sampling_rate_error_) &&
(ft_overload_flags_ == 0) &&
Expand Down Expand Up @@ -789,6 +792,7 @@ bool WG06::unpackFT(WG06StatusWithAccelAndFT *status, WG06StatusWithAccelAndFT *
if ( (usable_samples > 0) && (ft_publisher_ != NULL) && (ft_publisher_->trylock()) )
{
ft_publisher_->msg_.header.stamp = current_time;
ft_publisher_->msg_.header.frame_id = ft_link_id;
ft_publisher_->msg_.wrench = ft_state.samples_[usable_samples-1];
ft_publisher_->unlockAndPublish();
}
Expand Down

0 comments on commit de67121

Please sign in to comment.