Skip to content
This repository has been archived by the owner on Oct 18, 2018. It is now read-only.

Dynamic filters #21

Open
wants to merge 63 commits into
base: kinetic-devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
ad3afde
Removed dependecy on schunk_description (#6)
destogl May 27, 2017
e95298c
changes for working raw with fts
andreeatulbure May 31, 2017
5f95cf6
some changes for namespace read
andreeatulbure Jun 19, 2017
e3951af
rosparam working
andreeatulbure Jun 28, 2017
fca758b
added cs calibration params
andreeatulbure Jul 12, 2017
b3a71d4
added necessary code for simulation
andreeatulbure Jul 21, 2017
b949b77
Merge branch 'raw_with_fts' of https://github.com/iirob/ati_force_tor…
andreeatulbure Jul 21, 2017
9a2219e
changes for simulation.need to be cleaned
andreeatulbure Aug 3, 2017
90c6022
changes in fthandle_sim
andreeatulbure Aug 3, 2017
c2f67de
deleted prints
andreeatulbure Aug 3, 2017
7414daa
try to merge
andreeatulbure Aug 3, 2017
67f5ad9
merged master branch with raw_with_fts
andreeatulbure Aug 3, 2017
f44d9cb
small changes in urdf
andreeatulbure Aug 7, 2017
023f8e8
merged
andreeatulbure Aug 7, 2017
bad5adc
compatibility changes for iirob_fitlers
andreeatulbure Aug 8, 2017
e26d15f
Merge branch 'kinetic-devel' into raw_with_fts
destogl Aug 15, 2017
fe397dd
Use c++11 and update .travis
destogl Aug 15, 2017
2b8301b
Merge branch 'raw_with_fts' of github.com:iirob/ati_force_torque into…
destogl Aug 15, 2017
3fd59a8
Update .travis.rosinstall
destogl Aug 15, 2017
6d780de
Updated compile files and some Sim files headers
destogl Aug 16, 2017
86afc13
Merge branch 'raw_with_fts' of github.com:iirob/ati_force_torque into…
destogl Aug 16, 2017
386bfd1
made some changes
andreeatulbure Aug 16, 2017
0f24385
some more changes for PR
andreeatulbure Aug 16, 2017
acc18f8
changes for PR
andreeatulbure Aug 16, 2017
08fa91e
changed in fts.gazebo
andreeatulbure Aug 17, 2017
7095181
changes for PR
andreeatulbure Aug 18, 2017
40c9985
changes for PR and added sim parameter
andreeatulbure Aug 21, 2017
bfc3ea9
changes for working correctly with rosparam_handler
andreeatulbure Aug 22, 2017
cdd4da5
changes to work correctly with rosparam and real raw with fts
andreeatulbure Aug 22, 2017
db41caa
changes for working with real sensor and simulation
andreeatulbure Aug 22, 2017
0708b2e
not depending on own rosparam_handler anymore
andreeatulbure Aug 23, 2017
70c998b
chages for simulation of sensor
andreeatulbure Aug 24, 2017
bd7c110
using teleop not cob_teleop anymore
andreeatulbure Aug 24, 2017
0703060
remapped to cmd_force
andreeatulbure Aug 25, 2017
6f40f7a
changed default values for easier debugging
andreeatulbure Aug 25, 2017
d55fb2b
small changes
andreeatulbure Aug 28, 2017
9bca047
changes to use unchanged sensor_offsets
andreeatulbure Aug 28, 2017
88a5482
added realtime publisher and working with iirob_led
andreeatulbure Sep 28, 2017
23e5210
changes to work with iirob led
andreeatulbure Sep 28, 2017
8381779
some changes to work with rt publisher and iirob_led after test
andreeatulbure Sep 29, 2017
8a1e519
changes for working with iirob filters after changing to plugin
andreeatulbure Oct 5, 2017
f8e82f9
changes in urdf file for correct description when using sensor with sr2
andreeatulbure Oct 26, 2017
eaff13e
changes to work with filters pluginlib
andreeatulbure Oct 27, 2017
102a783
moved ati ft for sr2 to sr2_bringup
andreeatulbure Oct 27, 2017
cf5611a
Merge branch 'raw_with_fts' of https://github.com/iirob/ati_force_tor…
andreeatulbure Oct 27, 2017
d715e1c
undone small change in urdf
andreeatulbure Oct 27, 2017
9c05cd0
small change for sensor simulation
andreeatulbure Oct 27, 2017
4babe0b
Merge branch 'kinetic-devel' into raw_with_fts
destogl Oct 28, 2017
af78226
Update package.xml
destogl Nov 8, 2017
24bc24b
Update package.xml
destogl Nov 8, 2017
7048059
Removed iirob_led dependency.
destogl Nov 16, 2017
ce643a8
working branch with iirob_filters
andreeatulbure Nov 17, 2017
32bec61
working version with iirob_filters
andreeatulbure Nov 17, 2017
f995537
changes to work with wrench stamped as template
andreeatulbure Nov 17, 2017
2e5c378
Update .travis.rosinstall
destogl Nov 17, 2017
9373669
changes to work with iirob_filters moving mean filter
andreeatulbure Nov 20, 2017
1350021
Merge branch 'raw_with_fts' of https://github.com/iirob/ati_force_tor…
andreeatulbure Nov 20, 2017
d6235a6
use rosparam handler for gravity compensator
andreeatulbure Nov 20, 2017
bd04566
changes to work with filters
andreeatulbure Nov 22, 2017
1755a8e
added iirobFilterBase
andreeatulbure Nov 23, 2017
278996e
changes to work with dynamic loading of filters
andreeatulbure Nov 28, 2017
c94c2c2
changes to fully work with dynamic loading of filters
andreeatulbure Nov 29, 2017
a174b64
changes for dynamic filter loarding
andreeatulbure Nov 30, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.rosinstall
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- git:
uri: 'https://github.com/iirob/iirob_filters.git'
local-name: iirob_filters
version: kinetic-devel
version: raw_with_fts
- git:
uri: 'https://github.com/ipa320/cob_driver.git'
local-name: cob_driver
Expand Down
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ find_package(catkin REQUIRED COMPONENTS
tf2_ros
trajectory_msgs
visualization_msgs
realtime_tools
filters
)

find_package(Eigen3)
Expand Down Expand Up @@ -66,7 +68,7 @@ generate_messages(
###################################
catkin_package(
INCLUDE_DIRS common/include ros/include
CATKIN_DEPENDS cob_generic_can geometry_msgs iirob_filters message_runtime roscpp std_msgs std_srvs rospy tf2 tf2_ros tf2_geometry_msgs trajectory_msgs
CATKIN_DEPENDS cob_generic_can geometry_msgs iirob_filters message_runtime roscpp std_msgs std_srvs rospy tf2 tf2_ros tf2_geometry_msgs trajectory_msgs realtime_tools filters
DEPENDS Eigen
LIBRARIES ${PROJECT_NAME}
)
Expand Down
1 change: 1 addition & 0 deletions cfg/PublishConfiguration.params
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ gen.add("moving_mean", paramtype="bool", description="publish moving mean filter
gen.add("transformed_data", paramtype="bool", description="publish transformed data", default=True, configurable=True)
gen.add("gravity_compensated", paramtype="bool", description="publish gravity compensated data", default=True, configurable=True)
gen.add("threshold_filtered", paramtype="bool", description="publish threshold filtered data", default=True, configurable=True)
gen.add("iirob_led", paramtype="bool", description="publish data for iirob_led", default=True, configurable=True)

exit(gen.generate("ati_force_torque", "ForceTorqueSensor", "PublishConfiguration"))
63 changes: 16 additions & 47 deletions config/sensor_configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,63 +10,32 @@ Calibration:
n_measurements: 500
T_between_meas: 0.01
isStatic: false # true= use static offset Calibration, false=use calibrate Sensor to 0 in current State

ThresholdFilter:
linear_threshold: 2.5
angular_threshold: 0.3
name: ThresholdFilter
type: iirob_filters/ThresholdFilterWrench
params: {linear_threshold: 2.5, angular_threshold: 0.3}

LowPassFilter:
Force_x:
SamplingFrequency: 200.0
DampingFrequency: 15.0
DampingIntensity: -6.0
Force_y:
SamplingFrequency: 200.0
DampingFrequency: 15.0
DampingIntensity: -6.0
Force_z:
SamplingFrequency: 200.0
DampingFrequency: 15.0
DampingIntensity: -6.0
Torque_x:
SamplingFrequency: 200.0
DampingFrequency: 15.0
DampingIntensity: -6.0
Torque_y:
SamplingFrequency: 200.0
DampingFrequency: 15.0
DampingIntensity: -6.0
Torque_z:
SamplingFrequency: 200.0
DampingFrequency: 15.0
DampingIntensity: -6.0

name: LowPassFilter
type: iirob_filters/LowPassFilterWrench
params: {SamplingFrequency: 200.0, DampingFrequency: 15.0, DampingIntensity: -6.0}

MovingMeanFilter:
Force_x:
divider: 4
Force_y:
divider: 4
Force_z:
divider: 4
Torque_x:
divider: 4
Torque_y:
divider: 4
Torque_z:
divider: 4
name: MovingMeanFilter
type: iirob_filters/MovingMeanFilterWrench
params: {divider: 4}

GravityCompensation:
#CoG:
#x: 0
#y: 0
#z: 0.027346102 # m
#force: 7.9459955 # f_G
world_frame: "world"

name: GravityCompensation
type: iirob_filters/GravityCompensatorWrench
params: {world_frame: "base_link"}

Publish:
sensor_data: true
low_pass: true
moving_mean: true
transformed_data: true
gravity_compensated: true
threshold_filtered: true

73 changes: 0 additions & 73 deletions config/sensor_configuration_robot.yaml

This file was deleted.

3 changes: 3 additions & 0 deletions description/urdf/macros/mini58_sim.urdf.xacro
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">

<xacro:include filename="$(find ati_force_torque)/description/urdf/fts.transmission.xacro" />

<xacro:macro name="ati_mini58" params="parent name *origin">

<!-- Shift for -30 -90 -->
Expand Down
23 changes: 19 additions & 4 deletions description/urdf/sensor_mini58.urdf.xacro
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro"
name="ati_mini58" >
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="ati_mini58" >

<!-- ati_mini58 -->
<xacro:include filename="$(find ati_force_torque)/description/urdf/macros/mini58.urdf.xacro" />

<xacro:if value="$(arg sim)">
<xacro:include filename="$(find ati_force_torque)/description/urdf/macros/mini58_sim.urdf.xacro" />

<!-- Used for sensor simulation -->
<xacro:macro name="default_inertial">
<inertial>
<mass value="0.01"/>
<origin xyz="0 0 0"/>
<inertia ixx="0.001" ixy="0.0" ixz="0.0" iyy="0.001" iyz="0.0" izz="0.001" />
</inertial>
</xacro:macro>

</xacro:if>
<xacro:unless value="$(arg sim)">
<xacro:include filename="$(find ati_force_torque)/description/urdf/macros/mini58.urdf.xacro" />
</xacro:unless>

<!-- Used for fixing sensor to Gazebo -->
<link name="base_link"/>

<!-- sensor -->
<!-- sensor -->
<xacro:ati_mini58 name="fts" parent="base_link">
<origin xyz="0 0 0" rpy="0 0 0" />
</xacro:ati_mini58>
Expand Down
2 changes: 2 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
<depend>tf2_geometry_msgs</depend>
<depend>trajectory_msgs</depend>
<depend>visualization_msgs</depend>
<depend>realtime_tools</depend>
<depend>filters</depend>

<exec_depend>message_runtime</exec_depend>
<exec_depend>robot_state_publisher</exec_depend>
Expand Down
60 changes: 23 additions & 37 deletions ros/include/ati_force_torque/force_torque_sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ typedef unsigned char uint8_t;
#include <iirob_filters/gravity_compensation.h>
#include <iirob_filters/GravityCompensationParameters.h>
#include <iirob_filters/low_pass_filter.h>
#include <iirob_filters/moving_mean_filter.h>
#include <iirob_filters/threshold_filter.h>
#include <iirob_filters/moving_mean_filter.h>
#include <iirob_filters/iirob_filter_base.h>
#include <iirob_filters/iirob_filter_chain.h>

#include <math.h>
#include <iostream>
Expand All @@ -87,11 +89,15 @@ typedef unsigned char uint8_t;
#include <ati_force_torque/CanConfigurationParameters.h>
#include <ati_force_torque/FTSConfigurationParameters.h>
#include <ati_force_torque/PublishConfigurationParameters.h>
#include <ati_force_torque/PublishConfigurationConfig.h>
#include <ati_force_torque/NodeConfigurationParameters.h>
#include <ati_force_torque/CalibrationParameters.h>
#include <ati_force_torque/CalibrationConfig.h>

#include <filters/filter_chain.h>
#include <filters/filter_base.h>
#include <filters/mean.h>
#include <realtime_tools/realtime_publisher.h>

#define PI 3.14159265

class ForceTorqueSensor
Expand Down Expand Up @@ -145,7 +151,8 @@ class ForceTorqueSensor
geometry_msgs::Wrench offset_;
geometry_msgs::TransformStamped transform_ee_base_stamped;
tf2_ros::Buffer *p_tfBuffer;
ros::Publisher gravity_compensated_pub_, threshold_filtered_pub_, transformed_data_pub_, sensor_data_pub_, low_pass_pub_, moving_mean_pub_;
realtime_tools::RealtimePublisher<geometry_msgs::WrenchStamped> *gravity_compensated_pub_, *threshold_filtered_pub_, *transformed_data_pub_, *sensor_data_pub_, *low_pass_pub_, *moving_mean_pub_;

bool is_pub_gravity_compensated_ = false;
bool is_pub_threshold_filtered_ = false;
bool is_pub_transformed_data_ = false;
Expand All @@ -160,7 +167,7 @@ class ForceTorqueSensor
std::string canPath;
int canBaudrate;
int ftsBaseID;
double nodePubFreq;
double nodePubFreq, nodePullFreq;
uint calibrationNMeasurements;
double calibrationTBetween;
int coordinateSystemNMeasurements;
Expand Down Expand Up @@ -188,42 +195,21 @@ class ForceTorqueSensor
bool m_staticCalibration;
geometry_msgs::Wrench m_calibOffset;

ThresholdFilter threshold_filter_;

LowPassFilter lp_filter_force_x_;
LowPassFilter lp_filter_force_y_;
LowPassFilter lp_filter_force_z_;
LowPassFilter lp_filter_torque_x_;
LowPassFilter lp_filter_torque_y_;
LowPassFilter lp_filter_torque_z_;
MovingMeanFilter moving_mean_filter_force_x_;
MovingMeanFilter moving_mean_filter_force_y_;
MovingMeanFilter moving_mean_filter_force_z_;
MovingMeanFilter moving_mean_filter_torque_x_;
MovingMeanFilter moving_mean_filter_torque_y_;
MovingMeanFilter moving_mean_filter_torque_z_;

GravityCompensator gravity_compensator_;

bool useLowPassFilterForceX=false;
bool useLowPassFilterForceY=false;
bool useLowPassFilterForceZ=false;
bool useLowPassFilterTorqueX=false;
bool useLowPassFilterTorqueY=false;
bool useLowPassFilterTorqueZ=false;
bool useMovinvingMeanForceX= false;
bool useMovinvingMeanForceY= false;
bool useMovinvingMeanForceZ= false;
bool useMovinvingMeanTorqueX= false;
bool useMovinvingMeanTorqueY= false;
bool useMovinvingMeanTorqueZ= false;

iirob_filters::IIrobFilterChain<geometry_msgs::WrenchStamped, iirob_filters::IIrobFilterBase<geometry_msgs::WrenchStamped>> low_pass_filter_;
iirob_filters::IIrobFilterChain<geometry_msgs::WrenchStamped, iirob_filters::IIrobFilterBase<geometry_msgs::WrenchStamped>> moving_mean_filter_;
iirob_filters::IIrobFilterChain<geometry_msgs::WrenchStamped, iirob_filters::IIrobFilterBase<geometry_msgs::WrenchStamped>> threshold_filter_;
iirob_filters::IIrobFilterChain<geometry_msgs::WrenchStamped, iirob_filters::IIrobFilterBase<geometry_msgs::WrenchStamped>> gravity_compensator_;

bool useGravityCompensator=false;
bool useThresholdFilter=false;

bool useMovingMean = false;
bool useLowPassFilter = false;


dynamic_reconfigure::Server<ati_force_torque::CalibrationConfig> reconfigCalibrationSrv_; // Dynamic reconfiguration service
dynamic_reconfigure::Server<ati_force_torque::PublishConfigurationConfig> reconfigPublishSrv_; // Dynamic reconfiguration service
dynamic_reconfigure::Server<ati_force_torque::CalibrationConfig> reconfigCalibrationSrv_; // Dynamic reconfiguration service

void reconfigureCalibrationRequest(ati_force_torque::CalibrationConfig& config, uint32_t level);
void reconfigurePublishRequest(ati_force_torque::PublishConfigurationConfig& config, uint32_t level);
void reconfigureCalibrationRequest(ati_force_torque::CalibrationConfig& config, uint32_t level);
};

3 changes: 2 additions & 1 deletion ros/launch/driver.launch
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<arg name="sim" default="false"/>

<!-- send urdf to param server -->
<param name="sensor_description" command="$(find xacro)/xacro --inorder '$(find ati_force_torque)/description/urdf/sensor.urdf.xacro'" unless = "$(arg sim)"/>
<arg name="scenario_parameters" value="sim:=$(arg sim)"/>
<param name="sensor_description" command="$(find xacro)/xacro --inorder '$(find ati_force_torque)/description/urdf/sensor_mini58.urdf.xacro' $(arg scenario_parameters)"/>

<!-- sensor state publisher -->
<node ns="fts" pkg="robot_state_publisher" type="robot_state_publisher" name="sensor_state_publisher">
Expand Down
Loading