Skip to content

Commit b20ef46

Browse files
committed
Normalize axis, camera topics, zoom for link750
1 parent 3b6f3b0 commit b20ef46

File tree

1 file changed

+44
-17
lines changed

1 file changed

+44
-17
lines changed

urdf/link_750_nh.urdf.xacro

Lines changed: 44 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
<xacro:property name="ptz_mechanical_reduction" value="1.0"/>
88
<xacro:property name="PI" value="3.14159265359"/>
99

10-
<xacro:macro name="sensor_link_750_nh" params="prefix parent *origin far:=^|8.0 near:=^|0.05 prefix_topic:=^ptz_camera include_inertial:=^|true">
10+
<xacro:macro name="sensor_link_750_nh" params="prefix parent *origin far:=^|8.0 near:=^|0.05 prefix_topic:=^ptz_camera include_inertial:=^|true fps:=^|30.0">
1111

1212
<joint name="${prefix}_joint" type="fixed">
13-
<axis xyz="0 1 0"/>
13+
<axis xyz="0 0 1"/>
1414
<xacro:insert_block name="origin"/>
1515
<parent link="${parent}"/>
1616
<child link="${prefix}_base_link"/>
@@ -41,7 +41,7 @@
4141
</link>
4242

4343
<joint name="${prefix}_pan_joint" type="revolute">
44-
<axis xyz="0 0 -1"/>
44+
<axis xyz="0 0 1"/>
4545
<origin xyz="0.0 0.0 0.0318" rpy="0 0 0"/>
4646
<!-- check the displacement -->
4747
<parent link="${prefix}_base_link"/>
@@ -85,8 +85,8 @@
8585
</transmission>
8686

8787
<joint name="${prefix}_tilt_joint" type="revolute">
88-
<axis xyz="0 -1 0"/>
89-
<origin xyz="0.0 0.0 0.102" rpy="0 0 0"/>
88+
<axis xyz="0 0 1"/>
89+
<origin xyz="0.0 0.0 0.102" rpy="${PI/2} 0 0"/>
9090
<parent link="${prefix}_pan_link"/>
9191
<child link="${prefix}_tilt_link"/>
9292
<limit effort="${ptz_joint_effort_limit}" velocity="${ptz_joint_velocity_limit}" lower="-1.5708" upper="1.5708"/>
@@ -101,7 +101,7 @@
101101
</inertial>
102102
</xacro:if>
103103
<visual>
104-
<origin xyz="0 0 0" rpy="0 0 0"/>
104+
<origin xyz="0 0 0" rpy="${PI/2} 0 0"/>
105105
<material name="grey_color">
106106
<color rgba="0.1 0.1 0.1 1"/>
107107
</material>
@@ -110,7 +110,7 @@
110110
</geometry>
111111
</visual>
112112
<collision>
113-
<origin xyz="0.0 0.0 0" rpy="0 0 0"/>
113+
<origin xyz="0.0 0.0 0" rpy="${PI/2} 0 0"/>
114114
<geometry>
115115
<mesh filename="package://robotnik_sensors/meshes/link_750_tilt.stl" scale="1.0 1.0 1.0"/>
116116
</geometry>
@@ -127,8 +127,35 @@
127127
</actuator>
128128
</transmission>
129129

130+
<joint name="${prefix}_zoom_joint" type="prismatic">
131+
<axis xyz="0 0 1"/>
132+
<origin xyz="0.0 0.0 0.0" rpy="0 0 0"/>
133+
<parent link="${prefix}_optical_frame_link"/>
134+
<child link="${prefix}_zoom_link"/>
135+
<limit effort="1000.0" velocity="1" lower="0" upper="10000"/>
136+
</joint>
137+
<link name="${prefix}_zoom_link">
138+
<xacro:if value="${include_inertial}">
139+
<inertial>
140+
<mass value="0.1"/>
141+
<origin xyz="0 0 0" rpy="0 0 0"/>
142+
<xacro:solid_cuboid_inertia m="0.1" w="0.11" h="0.11" d="0.1" />
143+
</inertial>
144+
</xacro:if>
145+
</link>
146+
<transmission name="${prefix}_zoom_trans">
147+
<type>transmission_interface/SimpleTransmission</type>
148+
<joint name="${prefix}_zoom_joint">
149+
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
150+
</joint>
151+
<actuator name="${prefix}zoom_motor">
152+
<hardwareInterface>hardware_interface/PositionJointInterface</hardwareInterface>
153+
<mechanicalReduction>1</mechanicalReduction>
154+
</actuator>
155+
</transmission>
156+
130157
<joint name="${prefix}_frame_joint" type="fixed">
131-
<origin xyz="0 0 0" rpy="0 0 0"/>
158+
<origin xyz="0.06 0 0" rpy="${-PI/2} 0 0"/>
132159
<parent link="${prefix}_tilt_link"/>
133160
<child link="${prefix}_frame_link"/>
134161
</joint>
@@ -141,9 +168,9 @@
141168
</inertial>
142169
</xacro:if>
143170
</link>
144-
<!-- Optical frame -->
171+
<!-- Optical frame ${-M_PI/2} -->
145172
<joint name="${prefix}_optical_joint" type="fixed">
146-
<origin xyz="0.02 0 0" rpy="0 0 0"/>
173+
<origin xyz="0.0 0 0" rpy="${-M_PI/2} 0 ${-M_PI/2}"/>
147174
<parent link="${prefix}_frame_link"/>
148175
<child link="${prefix}_optical_frame_link"/>
149176
</joint>
@@ -168,9 +195,9 @@
168195

169196
<xacro:macro name="sensor_link_750_nh_gazebo">
170197

171-
<gazebo reference="${prefix}_optical_frame_link"> <!-- the image will be generated from this (${name}_frame) point of view, with the front being the X axis -->
198+
<gazebo reference="${prefix}_frame_link"> <!-- the image will be generated from this (${name}_frame) point of view, with the front being the X axis -->
172199
<sensor type="camera" name="${prefix}_sensor">
173-
<update_rate>30.0</update_rate>
200+
<update_rate>${fps}</update_rate>
174201
<camera name="${prefix_topic}">
175202
<horizontal_fov>${60.0*M_PI/180.0}</horizontal_fov>
176203
<image>
@@ -186,7 +213,7 @@
186213
<plugin name="${prefix}_controller" filename="libgazebo_ros_camera.so">
187214
<alwaysOn>true</alwaysOn>
188215
<updateRate>0.0</updateRate>
189-
<cameraName>top_rgb_${prefix_topic}</cameraName>
216+
<cameraName>${prefix_topic}/rgb</cameraName>
190217
<imageTopicName>image_raw</imageTopicName>
191218
<cameraInfoTopicName>camera_info</cameraInfoTopicName>
192219
<frameName>${prefix}_optical_frame_link</frameName>
@@ -202,7 +229,7 @@
202229
</plugin>
203230
</sensor>
204231
<sensor type="camera" name="thermal_${prefix}_sensor">
205-
<update_rate>30.0</update_rate>
232+
<update_rate>${fps}</update_rate>
206233
<camera>
207234
<horizontal_fov>${60.0*M_PI/180.0}</horizontal_fov>
208235
<image>
@@ -218,11 +245,11 @@
218245

219246
<plugin name="thermal_camera_controller" filename="libgazebo_ros_thermal_camera.so">
220247
<alwaysOn>true</alwaysOn>
221-
<updateRate>10</updateRate>
222-
<cameraName>top_thermal_${prefix_topic}</cameraName>
248+
<updateRate>${fps}</updateRate>
249+
<cameraName>${prefix_topic}/thermal</cameraName>
223250
<imageTopicName>image_raw</imageTopicName>
224251
<cameraInfoTopicName>camera_info</cameraInfoTopicName>
225-
<frameName>${prefix}_optical_frame_link</frameName>
252+
<frameName>${prefix}_frame_link</frameName>
226253
</plugin>
227254
</sensor>
228255
</gazebo>

0 commit comments

Comments
 (0)