|
7 | 7 | <xacro:property name="ptz_mechanical_reduction" value="1.0"/>
|
8 | 8 | <xacro:property name="PI" value="3.14159265359"/>
|
9 | 9 |
|
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"> |
11 | 11 |
|
12 | 12 | <joint name="${prefix}_joint" type="fixed">
|
13 |
| - <axis xyz="0 1 0"/> |
| 13 | + <axis xyz="0 0 1"/> |
14 | 14 | <xacro:insert_block name="origin"/>
|
15 | 15 | <parent link="${parent}"/>
|
16 | 16 | <child link="${prefix}_base_link"/>
|
|
41 | 41 | </link>
|
42 | 42 |
|
43 | 43 | <joint name="${prefix}_pan_joint" type="revolute">
|
44 |
| - <axis xyz="0 0 -1"/> |
| 44 | + <axis xyz="0 0 1"/> |
45 | 45 | <origin xyz="0.0 0.0 0.0318" rpy="0 0 0"/>
|
46 | 46 | <!-- check the displacement -->
|
47 | 47 | <parent link="${prefix}_base_link"/>
|
|
85 | 85 | </transmission>
|
86 | 86 |
|
87 | 87 | <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"/> |
90 | 90 | <parent link="${prefix}_pan_link"/>
|
91 | 91 | <child link="${prefix}_tilt_link"/>
|
92 | 92 | <limit effort="${ptz_joint_effort_limit}" velocity="${ptz_joint_velocity_limit}" lower="-1.5708" upper="1.5708"/>
|
|
101 | 101 | </inertial>
|
102 | 102 | </xacro:if>
|
103 | 103 | <visual>
|
104 |
| - <origin xyz="0 0 0" rpy="0 0 0"/> |
| 104 | + <origin xyz="0 0 0" rpy="${PI/2} 0 0"/> |
105 | 105 | <material name="grey_color">
|
106 | 106 | <color rgba="0.1 0.1 0.1 1"/>
|
107 | 107 | </material>
|
|
110 | 110 | </geometry>
|
111 | 111 | </visual>
|
112 | 112 | <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"/> |
114 | 114 | <geometry>
|
115 | 115 | <mesh filename="package://robotnik_sensors/meshes/link_750_tilt.stl" scale="1.0 1.0 1.0"/>
|
116 | 116 | </geometry>
|
|
127 | 127 | </actuator>
|
128 | 128 | </transmission>
|
129 | 129 |
|
| 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 | + |
130 | 157 | <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"/> |
132 | 159 | <parent link="${prefix}_tilt_link"/>
|
133 | 160 | <child link="${prefix}_frame_link"/>
|
134 | 161 | </joint>
|
|
141 | 168 | </inertial>
|
142 | 169 | </xacro:if>
|
143 | 170 | </link>
|
144 |
| - <!-- Optical frame --> |
| 171 | + <!-- Optical frame ${-M_PI/2} --> |
145 | 172 | <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}"/> |
147 | 174 | <parent link="${prefix}_frame_link"/>
|
148 | 175 | <child link="${prefix}_optical_frame_link"/>
|
149 | 176 | </joint>
|
|
168 | 195 |
|
169 | 196 | <xacro:macro name="sensor_link_750_nh_gazebo">
|
170 | 197 |
|
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 --> |
172 | 199 | <sensor type="camera" name="${prefix}_sensor">
|
173 |
| - <update_rate>30.0</update_rate> |
| 200 | + <update_rate>${fps}</update_rate> |
174 | 201 | <camera name="${prefix_topic}">
|
175 | 202 | <horizontal_fov>${60.0*M_PI/180.0}</horizontal_fov>
|
176 | 203 | <image>
|
|
186 | 213 | <plugin name="${prefix}_controller" filename="libgazebo_ros_camera.so">
|
187 | 214 | <alwaysOn>true</alwaysOn>
|
188 | 215 | <updateRate>0.0</updateRate>
|
189 |
| - <cameraName>top_rgb_${prefix_topic}</cameraName> |
| 216 | + <cameraName>${prefix_topic}/rgb</cameraName> |
190 | 217 | <imageTopicName>image_raw</imageTopicName>
|
191 | 218 | <cameraInfoTopicName>camera_info</cameraInfoTopicName>
|
192 | 219 | <frameName>${prefix}_optical_frame_link</frameName>
|
|
202 | 229 | </plugin>
|
203 | 230 | </sensor>
|
204 | 231 | <sensor type="camera" name="thermal_${prefix}_sensor">
|
205 |
| - <update_rate>30.0</update_rate> |
| 232 | + <update_rate>${fps}</update_rate> |
206 | 233 | <camera>
|
207 | 234 | <horizontal_fov>${60.0*M_PI/180.0}</horizontal_fov>
|
208 | 235 | <image>
|
|
218 | 245 |
|
219 | 246 | <plugin name="thermal_camera_controller" filename="libgazebo_ros_thermal_camera.so">
|
220 | 247 | <alwaysOn>true</alwaysOn>
|
221 |
| - <updateRate>10</updateRate> |
222 |
| - <cameraName>top_thermal_${prefix_topic}</cameraName> |
| 248 | + <updateRate>${fps}</updateRate> |
| 249 | + <cameraName>${prefix_topic}/thermal</cameraName> |
223 | 250 | <imageTopicName>image_raw</imageTopicName>
|
224 | 251 | <cameraInfoTopicName>camera_info</cameraInfoTopicName>
|
225 |
| - <frameName>${prefix}_optical_frame_link</frameName> |
| 252 | + <frameName>${prefix}_frame_link</frameName> |
226 | 253 | </plugin>
|
227 | 254 | </sensor>
|
228 | 255 | </gazebo>
|
|
0 commit comments