Skip to content

Commit 5441e9e

Browse files
committed
try to add force torque sensor controller [Status: failed]
1 parent 65a2c4a commit 5441e9e

23 files changed

Lines changed: 318 additions & 32 deletions

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@ find_package(catkin REQUIRED COMPONENTS
1111
controller_interface
1212
controller_manager
1313
hardware_interface
14+
force_torque_sensor_controller
15+
1416
)
1517

16-
catkin_package()
18+
catkin_package(
19+
INCLUDE_DIRS include
20+
CATKIN_DEPENDS hardware_interface controller_interface)
1721

1822

1923
include_directories(include
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env deployer-gnulinux
2+
3+
import("rtt_ros")
4+
import("rtt_rosnode")
5+
ros.import("ft_sensor_hw")
6+
7+
## Give it a periodic activity
8+
setActivity("ft_sensor_hw", 1.0/1000.0, HighestPriority, ORO_SCHED_RT)
9+
10+
## Configure the RttRosControlExample component
11+
ft_sensor_hw .init()
12+
13+
## Start it
14+
#ForceTorqueSensorController.starting()
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
force_torque_sensor_controller:
2+
type: force_torque_sensor_controller/ForceTorqueSensorController
3+
publish_rate: 1000
4+

config/hardware_interfaces.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# make the namespace match the name you use to instantiate the sensor in the xacro
2+
#my_sensor:
3+
#ForceTorqueSensorInterface:
4+
#type: hardware_interface/ForceTorqueSensorInterface
5+
#type: hardware_interface/ForceTorqueSensorHandle
6+
root: my_sensor_gamma_base
7+
tip: my_sensor_gamma_measure
8+
joints:
9+
- world_my_sensor_measure_joint
10+

config/joint_names.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
joints:
2+
- world_my_sensor_measure_joint

config/joint_state_controller.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Publish all joint states
2+
#my_sensor:
3+
joint_state_controller:
4+
type: joint_state_controller/JointStateController
5+
publish_rate: 1000
6+
joints:
7+
- world_my_sensor_measure_joint
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<launch>
2+
<group ns="my_sensor">
3+
<rosparam command="load" file="$(find force_torque_sensor)/config/force_torque_sensor_controller.yaml"/>
4+
<!-- load hardware interface-->
5+
<rosparam command="load" file="$(find force_torque_sensor)/config/hardware_interfaces.yaml"/>
6+
<!-- load position controllers -->
7+
<!-- <node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false"
8+
output="screen" ns="/ft_sensor" args="
9+
joint_state_controller world_my_sensor_measure_joint"/>
10+
-->
11+
12+
13+
14+
15+
<node name="force_torque_sensor_controller" pkg="controller_manager" type="spawner" output="screen" ns="/my_sensor" args="force_torque_sensor_controller" />
16+
17+
</group>
18+
</launch>

launch/cylinder_spawner.launch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<launch>
22
<!-- Spawn a robot into Gazebo -->
3-
<param name="cylinder_description" command="$(find xacro)/xacro.py $(find vito_description)/model/cylinder.urdf.xacro" />
3+
<param name="cylinder_description" command="$(find xacro)/xacro.py $(find force_torque_sensor)/robot/cylinder.urdf.xacro" />
44
<node name="cylinder_spawner" pkg="gazebo_ros" type="spawn_model" args="-param cylinder_description -urdf -model cylinder -x -0.0 -y -0.0 -z 0.30 -R 0 -P 0 -Y 0" respawn="false" output="screen"/>
55
</launch>

launch/display_simulation.launch

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
<node name="robot_tf_publisher" pkg="robot_state_publisher" type="robot_state_publisher"/>
99

1010
<!-- EXAMPLE FOR NANO17 -->
11-
<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-param robot_description -urdf -model gamma" respawn="false" output="screen" />
1211

1312
<include file="$(find gazebo_ros)/launch/empty_world.launch">
1413
<arg name="world_name" value="$(find force_torque_sensor)/worlds/simple_environment.world"/>
@@ -17,26 +16,36 @@
1716
<arg name="gui" value="true"/>
1817
<arg name="headless" value="false"/>
1918
<arg name="debug" value="false"/>
20-
</include>
19+
</include>
2120

21+
<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-param robot_description -urdf -model nano17" respawn="false" output="screen" />
22+
23+
2224
<node name="ft_sensor_rviz" pkg="rviz" type="rviz" respawn="false" args="-d $(find force_torque_sensor)/launch/my_config_rviz.rviz" output="screen"/>
2325

24-
<node name="rqt_plot_view_force" pkg="rqt_plot" type="rqt_plot" args="-e /world_my_sensor/ft_sensor_topic/wrench/force/x:y:z" />
25-
<node name="rqt_plot_view_torque" pkg="rqt_plot" type="rqt_plot" args="-e /world_my_sensor/ft_sensor_topic/wrench/torque/x:y:z" />
26+
<node name="rqt_plot_view_force" pkg="rqt_plot" type="rqt_plot" args="-e /world_my_sensor/ft_sensor_topic/wrench/force" />
27+
<node name="rqt_plot_view_torque" pkg="rqt_plot" type="rqt_plot" args="-e /world_my_sensor/ft_sensor_topic/wrench/torque" />
2628

2729

28-
<group ns="my_sensor">
30+
<!--
31+
<group ns="my_sensor">
2932
<rosparam command="load" file="$(find force_torque_sensor)/config/force_torque_sensor_controller.yaml"/>
33+
-->
3034
<!-- load hardware interface-->
35+
<!--
3136
<rosparam command="load" file="$(find force_torque_sensor)/config/hardware_interfaces.yaml"/>
3237
<rosparam file="$(find force_torque_sensor)/config/joint_names.yaml" command="load"/>
33-
<!-- load position controllers -->
34-
<!-- <node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false"
38+
-->
39+
<!--load force torque sensor controllers -->
40+
<!--
41+
<node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false"
3542
output="screen" ns="/ft_sensor" args="
3643
joint_state_controller world_my_sensor_measure_joint"/>
37-
-->
44+
3845
</group>
3946
<node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false" output="screen" ns="/my_sensor" args="force_torque_sensor_controller" />
47+
-->
48+
4049

4150

4251

launch/ft_sensor_hw.launch.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
<launch>
22

33
<!-- LAUNCH INTERFACE FOR FT SENSORS -->
4-
5-
<arg name="ip" doc="Network address of the sensor. Mandatory"/>
64
<arg name="name" doc="Name of the sensor for unique identification, it depends on your URDF implementation. Mandatory."/>
75
<arg name="type" doc="Type of sensor, e.g. nano17, it depends on your URDF implementation, check which models this package supports. Mandatory."/>
86

97
<!-- LAUNCH IMPLEMENTATION -->
108
<group ns="$(arg name)">
119
<node name="ft_sensor_hw" pkg="force_torque_sensor" type="ft_sensor_hw" respawn="true" output="screen">
12-
<param name="ip" value="$(arg ip)"/>
1310
<param name="name" value="$(arg name)" />
1411
<param name="type" value="$(arg type)" />
1512
</node>

0 commit comments

Comments
 (0)