Skip to content

Commit 2a214c2

Browse files
committed
Try to add force torque sensor controller and visualization of force and torque
1 parent 3d221f8 commit 2a214c2

5 files changed

Lines changed: 32 additions & 11 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
force_torque_sensor_controller:
2+
type: force_torque_sensor_controller/ForceTorqueSensorController
3+
publish_rate: 1000

launch/display_simulation.launch

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
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 nano17" respawn="false" output="screen" />
11+
<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-param robot_description -urdf -model gamma" respawn="false" output="screen" />
1212

1313
<include file="$(find gazebo_ros)/launch/empty_world.launch">
1414
<arg name="world_name" value="$(find force_torque_sensor)/worlds/simple_environment.world"/>
@@ -21,4 +21,22 @@
2121

2222
<node name="ft_sensor_rviz" pkg="rviz" type="rviz" respawn="false" args="-d $(find force_torque_sensor)/launch/my_config_rviz.rviz" output="screen"/>
2323

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+
27+
28+
<!-- Load joint controller configurations from YAML file to parameter server -->
29+
<!-- <rosparam file="$(find force_torque_sensor)/config/force_torque_sensor_control.yaml" command="load"/> -->
30+
<rosparam command="load" file="$(find force_torque_sensor)/config/force_torque_sensor_control.yaml" />
31+
32+
<!-- load position controllers -->
33+
<!-- <node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false"
34+
output="screen" ns="/ft_sensor" args="
35+
joint_state_controller world_my_sensor_measure_joint"/>
36+
-->
37+
38+
<node name="force_torque_sensor_controller" pkg="controller_manager" type="spawner" output="screen" args="force_torque_sensor_controller" />
39+
40+
41+
2442
</launch>

launch/my_config_rviz.rviz

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Panels:
77
- /Global Options1
88
- /Status1
99
- /WrenchStamped1
10-
- /WrenchStamped1/Status1
1110
Splitter Ratio: 0.5
1211
Tree Height: 595
1312
- Class: rviz/Selection
@@ -94,22 +93,22 @@ Visualization Manager:
9493
{}
9594
Update Interval: 0
9695
Value: false
97-
- Alpha: 1
96+
- Alpha: 0.5
9897
Arrow Width: 0.06
9998
Class: rviz/WrenchStamped
10099
Enabled: true
101-
Force Arrow Scale: 2
100+
Force Arrow Scale: 0.1
102101
Force Color: 255; 0; 0
103102
History Length: 1
104103
Name: WrenchStamped
105104
Topic: /world_my_sensor/ft_sensor_topic
106-
Torque Arrow Scale: 2
105+
Torque Arrow Scale: 0.1
107106
Torque Color: 0; 0; 127
108107
Value: true
109108
Enabled: true
110109
Global Options:
111110
Background Color: 48; 48; 48
112-
Fixed Frame: world
111+
Fixed Frame: my_sensor_gamma_measure
113112
Frame Rate: 30
114113
Name: root
115114
Tools:
@@ -130,7 +129,7 @@ Visualization Manager:
130129
Views:
131130
Current:
132131
Class: rviz/Orbit
133-
Distance: 0.19719
132+
Distance: 0.759513
134133
Enable Stereo Rendering:
135134
Stereo Eye Separation: 0.06
136135
Stereo Focal Distance: 1
@@ -142,10 +141,10 @@ Visualization Manager:
142141
Z: -0.00691727
143142
Name: Current View
144143
Near Clip Distance: 0.01
145-
Pitch: 0.165397
144+
Pitch: 0.0803973
146145
Target Frame: <Fixed Frame>
147146
Value: Orbit (rviz)
148-
Yaw: 0.240414
147+
Yaw: 3.71859
149148
Saved: ~
150149
Window Geometry:
151150
Displays:

model/ft_sensor.gazebo.xacro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
<xacro:macro name="ft_sensor_gazebo" params="parent name type">
55

6+
67
<gazebo reference="${name}_${type}_base">
78
<gravity>true</gravity>
89
</gazebo>
@@ -24,7 +25,7 @@
2425
<noise>
2526
<type>gaussian</type>
2627
<mean>0.0</mean>
27-
<stddev>0.003</stddev> <!-- change this to simulate noise -->
28+
<stddev>0.003</stddev> <!-- change this to simulate noise 0.003-->
2829
</noise>
2930
</plugin>
3031
</gazebo>

model/ft_sensor.urdf.xacro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
<parent link="${name}_${type}_base"/>
2727
<child link="${name}_${type}_measure"/>
28-
<limit lower="0" upper="0" effort="100" velocity="100"/>
28+
<limit lower="0" upper="0" effort="0" velocity="0"/>
2929
<axis xyz="0 0 1" />
3030
</joint>
3131

0 commit comments

Comments
 (0)