// it's for Latex

pages

[SLAM] #02. 3D Modeling Mobile Robot

연구 관련하여 Mobile Robot을 활용해야 할 일이 있었고, 실제로 Mobile Robot을 이용해 실험하기 전에 Simulation을 통해 전체적인 시스템 및 알고리즘을 정리하고자 하였다. Mobile Robot을 Simulation 하기 위해서는 먼저 3D Modeling을 진행하여야 했고, 해당 내용을 여기에 정리하였다.


작업환경
OS : Ubuntu 16.06 LTS
ROS version : Kinetic
Compiler : catkin


1. Making Package

$ cd catkin_ws/src/
$ catkin_create_pkg chapter7_tutorials

Created file chapter7_tutorials/CMakeLists.txt
Created file chapter7_tutorials/package.xml
Successfully created files in /home/eh420/catkin_ws/src/chapter7_tutorials. Please adjust the values in package.xml.


$ cd chapter7_tutorials/
$ mkdir urdf
$ cd urdf/


2. Writing URDF Source

$ sudo nano robot1.urdf

아래 소스 복사 및 붙여넣기

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?xml version="1.0" encoding="" ?>
    <robot name = "Robot1">
        <link name = "base_link">
            <visual>
                <geometry>
                    <box size="0.2 .3 .1"/>
                </geometry>
                <origin rpy ="0 0 0" xyz="0 0 0.05"/>
                <material name="white">
                    <color rgba="1 1 1 1"/>
                </material>
            </visual>
        </link>
        <link name = "wheel_1">
            <visual>
                <geometry>
                    <cylinder length = "0.05" radius="0.05"/>
                </geometry>
                <origin rpy = "0 1.5 0" xyz="0.1 0.1 0"/>
                    <material name="black">
                        <color rgba="0 0 0 1"/>
                    </material>
            </visual>
        </link>
        <link name = "wheel_2">
            <visual>
                <geometry>
                    <cylinder length = "0.05" radius="0.05"/>
                </geometry>
                <origin rpy = "0 1.5 0" xyz="-0.1 0.1 0"/>
                    <material name="black"/>
            </visual>
        </link>
        <link name = "wheel_3">
            <visual>
                <geometry>
                    <cylinder length = "0.05" radius="0.05"/>
                </geometry>
                <origin rpy = "0 1.5 0" xyz="0.1 -0.1 0"/>
                    <material name="black"/>
            </visual>
        </link>
        <link name = "wheel_4">
            <visual>
                <geometry>
                    <cylinder length = "0.05" radius="0.05"/>
                </geometry>
                <origin rpy = "0 1.5 0" xyz="-0.1 -0.1 0"/>
                    <material name="black"/>
            </visual>
        </link>
        <joint name="base_to_wheel1" type="fixed">
            <parent link = "base_link"/>
            <child link="wheel_1"/>
            <origin xyz="0 0 0"/>
        </joint>
        <joint name="base_to_wheel2" type="fixed">
            <parent link = "base_link"/>
            <child link="wheel_2"/>
            <origin xyz="0 0 0"/>
        </joint>
        <joint name="base_to_wheel3" type="fixed">
            <parent link = "base_link"/>
            <child link="wheel_3"/>
            <origin xyz="0 0 0"/>
        </joint>
        <joint name="base_to_wheel4" type="fixed">
            <parent link = "base_link"/>
            <child link="wheel_4"/>
            <origin xyz="0 0 0"/>
        </joint>
</robot>
cs

3. Check the URDF with Command
$ check_urdf robot1.urdf

4. Check the URDF with Graphic
$ urdf_to_graphiz robot1.urdf
$ evince Robot1.pdf

5. Writing Launch Source
$ cd chapter7_tutorials/
$ mkdir launch
$ cd launch/
$ nano display.launch
아래 소스 복사 및 붙여넣기

1
2
3
4
5
6
7
8
9
10
11
<?xml version="1.0"?>
<launch>
    <arg name="model"/>
    <arg name="gui" default="False"/>
    <param name="robot_description" textfile="$(arg model)"/>
    <param name="use_gui" value="$(arg gui)"/>
    <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher"/>
    <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher"/>
</launch>
cs

6. 실행
$ roslaunch chapter7_tutorials display.launch model:="`rospack find chapter7_tutorials`/urdf/robot1.urdf"
$ rviz
Fixed Frame을 base_linke로 변경
Add 클릭하여 RobotModel 추가


댓글 없음:

댓글 쓰기