-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[description] Generalization. Add unit test using kobuki.
- Loading branch information
Showing
8 changed files
with
111 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?xml version="1.0"?> | ||
<robot name="kinect_gazebo" xmlns:xacro="http://wiki.ros.org/xacro"> | ||
<!-- Microsoft Kinect / ASUS Xtion PRO Live for simulation --> | ||
<xacro:macro name="sim_3dsensor_kinect"> | ||
<gazebo reference="camera_link"> | ||
<sensor type="depth" name="camera"> | ||
<always_on>true</always_on> | ||
<update_rate>20.0</update_rate> | ||
<camera> | ||
<horizontal_fov>${60.0*M_PI/180.0}</horizontal_fov> | ||
<image> | ||
<format>B8G8R8</format> | ||
<width>640</width> | ||
<height>480</height> | ||
</image> | ||
<clip> | ||
<near>0.05</near> | ||
<far>8.0</far> | ||
</clip> | ||
</camera> | ||
<plugin name="kinect_camera_controller" filename="libgazebo_ros_openni_kinect.so"> | ||
<cameraName>camera</cameraName> | ||
<alwaysOn>true</alwaysOn> | ||
<updateRate>10</updateRate> | ||
<imageTopicName>rgb/image_raw</imageTopicName> | ||
<depthImageTopicName>depth/image_raw</depthImageTopicName> | ||
<pointCloudTopicName>depth/points</pointCloudTopicName> | ||
<cameraInfoTopicName>rgb/camera_info</cameraInfoTopicName> | ||
<depthImageCameraInfoTopicName>depth/camera_info</depthImageCameraInfoTopicName> | ||
<frameName>camera_depth_optical_frame</frameName> | ||
<baseline>0.1</baseline> | ||
<distortion_k1>0.0</distortion_k1> | ||
<distortion_k2>0.0</distortion_k2> | ||
<distortion_k3>0.0</distortion_k3> | ||
<distortion_t1>0.0</distortion_t1> | ||
<distortion_t2>0.0</distortion_t2> | ||
<pointCloudCutoff>0.4</pointCloudCutoff> | ||
</plugin> | ||
</sensor> | ||
</gazebo> | ||
</xacro:macro> | ||
</robot> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<launch> | ||
<node pkg="xacro" type="xacro" name="kobuki_urdf_generation" args="$(find openni_description)/test/sample_kobuki.urdf.xacro -o sample_kobuki.urdf" /> | ||
<test pkg="openni_description" type="test_openni_desc.py" test-name="test_openni_descriptioner" /> | ||
</launch> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0"?> | ||
<robot name="turtlebot" xmlns:xacro="http://wiki.ros.org/xacro"> | ||
<xacro:include filename="$(find turtlebot_description)/urdf/turtlebot_common_library.urdf.xacro" /> | ||
<xacro:include filename="$(find kobuki_description)/urdf/kobuki.urdf.xacro" /> | ||
<xacro:include filename="$(find turtlebot_description)/urdf/stacks/hexagons.urdf.xacro" /> | ||
<xacro:include filename="$(find openni_description)/model/kinect.urdf.xacro" /> | ||
<xacro:include filename="$(find openni_description)/test/turtlebot_properties.urdf.xacro"/> | ||
|
||
<sensor_kinect parent="base_link" cam_px="${cam_px}" cam_py="${cam_py}" cam_pz="${cam_pz}" cam_or="${cam_or}" cam_op="${cam_op}" cam_oy="${cam_oy}" /> | ||
|
||
<kobuki /> | ||
<stack_hexagons parent="base_link" /> | ||
</robot> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
PKG = 'openni_description' | ||
|
||
import os | ||
import subprocess | ||
import unittest | ||
|
||
import rospkg | ||
|
||
|
||
class TestOpenniDescription(unittest.TestCase): | ||
|
||
def setUp(self): | ||
pass | ||
|
||
def tearDown(self): | ||
True | ||
|
||
def test_urdf_turtlebot(self): | ||
""" | ||
Check if check_urdf command passes with the urdf that is generated in | ||
the .test file this test case is called from. | ||
""" | ||
self.assertTrue(os.path.isfile(rospkg.RosPack().get_path('openni_description') + "/test/sample_kobuki.urdf.xacro") | ||
print(subprocess.check_output(["rosrun", "xacro", "xacro", rospkg.RosPack().get_path('openni_description') + "/test/sample_kobuki.urdf.xacro", "-o", "./sample_kobuki.urdf"])) | ||
self.assertEqual(0, subprocess.call(["check_urdf", "./sample_kobuki.urdf"])) | ||
|
||
if __name__ == '__main__': | ||
import rostest | ||
rostest.rosrun(PKG, 'test_openni_description', TestOpenniDescription) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters