Browse Source

新增robot_description源码

corvin 4 years ago
parent
commit
1cc39bc64e

+ 1 - 1
src/robot_bringup/launch/robot_bringup.launch

@@ -11,7 +11,7 @@
 -->
 <launch>
     <!-- (1) startup robot urdf description -->
-    <!--include file="$(find robot_description)/launch/robot_description.launch" /-->
+    <include file="$(find robot_description)/launch/robot_description.launch" />
 
     <!-- (2) startup mobilebase arduino launch -->
     <include file="$(find ros_arduino_python)/launch/arduino.launch" />

+ 14 - 0
src/robot_description/CMakeLists.txt

@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 2.8.3)
+
+project(robot_description)
+
+find_package(catkin REQUIRED)
+
+catkin_package()
+
+find_package(roslaunch)
+
+foreach(dir config launch meshes urdf)
+	install(DIRECTORY ${dir}/
+		DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/${dir})
+endforeach(dir)

+ 1 - 0
src/robot_description/config/joint_names.yaml

@@ -0,0 +1 @@
+controller_joint_names: []

+ 246 - 0
src/robot_description/config/urdf.rviz

@@ -0,0 +1,246 @@
+Panels:
+  - Class: rviz/Displays
+    Help Height: 78
+    Name: Displays
+    Property Tree Widget:
+      Expanded:
+        - /TF1/Frames1
+        - /Odometry1/Shape1
+        - /Odometry1/Covariance1
+      Splitter Ratio: 0.449999988
+    Tree Height: 595
+  - Class: rviz/Selection
+    Name: Selection
+  - Class: rviz/Tool Properties
+    Expanded:
+      - /2D Pose Estimate1
+      - /2D Nav Goal1
+      - /Publish Point1
+    Name: Tool Properties
+    Splitter Ratio: 0.588679016
+  - Class: rviz/Views
+    Expanded:
+      - /Current View1
+    Name: Views
+    Splitter Ratio: 0.5
+  - Class: rviz/Time
+    Experimental: false
+    Name: Time
+    SyncMode: 0
+    SyncSource: ""
+Toolbars:
+  toolButtonStyle: 2
+Visualization Manager:
+  Class: ""
+  Displays:
+    - Alpha: 0.5
+      Cell Size: 1
+      Class: rviz/Grid
+      Color: 160; 160; 164
+      Enabled: true
+      Line Style:
+        Line Width: 0.0299999993
+        Value: Lines
+      Name: Grid
+      Normal Cell Count: 0
+      Offset:
+        X: 0
+        Y: 0
+        Z: 0
+      Plane: XY
+      Plane Cell Count: 10
+      Reference Frame: <Fixed Frame>
+      Value: true
+    - Alpha: 1
+      Class: rviz/RobotModel
+      Collision Enabled: false
+      Enabled: true
+      Links:
+        All Links Enabled: true
+        Expand Joint Details: false
+        Expand Link Details: false
+        Expand Tree: false
+        Link Tree Style: Links in Alphabetic Order
+        base_footprint:
+          Alpha: 1
+          Show Axes: false
+          Show Trail: false
+          Value: true
+        base_imu_link:
+          Alpha: 1
+          Show Axes: false
+          Show Trail: false
+          Value: true
+        base_link:
+          Alpha: 1
+          Show Axes: false
+          Show Trail: false
+          Value: true
+        lidar:
+          Alpha: 1
+          Show Axes: false
+          Show Trail: false
+          Value: true
+      Name: RobotModel
+      Robot Description: robot_description
+      TF Prefix: ""
+      Update Interval: 0
+      Value: true
+      Visual Enabled: true
+    - Class: rviz/TF
+      Enabled: true
+      Frame Timeout: 15
+      Frames:
+        All Enabled: true
+        base_footprint:
+          Value: true
+        base_imu_link:
+          Value: true
+        base_link:
+          Value: true
+        lidar:
+          Value: true
+        odom_combined:
+          Value: true
+      Marker Scale: 0.300000012
+      Name: TF
+      Show Arrows: true
+      Show Axes: true
+      Show Names: true
+      Tree:
+        odom_combined:
+          base_footprint:
+            base_link:
+              base_imu_link:
+                {}
+              lidar:
+                {}
+      Update Interval: 0
+      Value: true
+    - Alpha: 1
+      Autocompute Intensity Bounds: true
+      Autocompute Value Bounds:
+        Max Value: 10
+        Min Value: -10
+        Value: true
+      Axis: Z
+      Channel Name: intensity
+      Class: rviz/LaserScan
+      Color: 255; 255; 255
+      Color Transformer: Intensity
+      Decay Time: 0
+      Enabled: true
+      Invert Rainbow: false
+      Max Color: 255; 255; 255
+      Max Intensity: 253
+      Min Color: 0; 0; 0
+      Min Intensity: 252
+      Name: LaserScan
+      Position Transformer: XYZ
+      Queue Size: 10
+      Selectable: true
+      Size (Pixels): 3
+      Size (m): 0.00999999978
+      Style: Flat Squares
+      Topic: /scan
+      Unreliable: false
+      Use Fixed Frame: true
+      Use rainbow: true
+      Value: true
+    - Angle Tolerance: 0.100000001
+      Class: rviz/Odometry
+      Covariance:
+        Orientation:
+          Alpha: 0.5
+          Color: 255; 255; 127
+          Color Style: Unique
+          Frame: Local
+          Offset: 1
+          Scale: 1
+          Value: true
+        Position:
+          Alpha: 0.300000012
+          Color: 204; 51; 204
+          Scale: 1
+          Value: true
+        Value: false
+      Enabled: true
+      Keep: 100
+      Name: Odometry
+      Position Tolerance: 0.100000001
+      Shape:
+        Alpha: 0.5
+        Axes Length: 1
+        Axes Radius: 0.100000001
+        Color: 218; 78; 43
+        Head Length: 0.100000001
+        Head Radius: 0.0299999993
+        Shaft Length: 0.0500000007
+        Shaft Radius: 0.00999999978
+        Value: Arrow
+      Topic: /odom_ekf
+      Unreliable: false
+      Value: true
+  Enabled: true
+  Global Options:
+    Background Color: 48; 48; 48
+    Default Light: true
+    Fixed Frame: odom_combined
+    Frame Rate: 30
+  Name: root
+  Tools:
+    - Class: rviz/Interact
+      Hide Inactive Objects: true
+    - Class: rviz/MoveCamera
+    - Class: rviz/Select
+    - Class: rviz/FocusCamera
+    - Class: rviz/Measure
+    - Class: rviz/SetInitialPose
+      Topic: /initialpose
+    - Class: rviz/SetGoal
+      Topic: /move_base_simple/goal
+    - Class: rviz/PublishPoint
+      Single click: true
+      Topic: /clicked_point
+  Value: true
+  Views:
+    Current:
+      Class: rviz/Orbit
+      Distance: 3.11365533
+      Enable Stereo Rendering:
+        Stereo Eye Separation: 0.0599999987
+        Stereo Focal Distance: 1
+        Swap Stereo Eyes: false
+        Value: false
+      Focal Point:
+        X: 0.162931487
+        Y: 0.0532836765
+        Z: 0.289979368
+      Focal Shape Fixed Size: true
+      Focal Shape Size: 0.0500000007
+      Invert Z Axis: false
+      Name: Current View
+      Near Clip Distance: 0.00999999978
+      Pitch: 0.614797473
+      Target Frame: <Fixed Frame>
+      Value: Orbit (rviz)
+      Yaw: 5.10729408
+    Saved: ~
+Window Geometry:
+  Displays:
+    collapsed: true
+  Height: 876
+  Hide Left Dock: true
+  Hide Right Dock: true
+  QMainWindow State: 000000ff00000000fd00000004000000000000016a000002e2fc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000006100fffffffb0000001e0054006f006f006c002000500072006f0070006500720074006900650073020000019b000001b500000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c0061007900730000000028000002e2000000d700fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000010f00000168fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073000000004100000168000000ad00fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000006400000003efc0100000002fb0000000800540069006d00650100000000000006400000030000fffffffb0000000800540069006d0065010000000000000450000000000000000000000640000002e200000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000
+  Selection:
+    collapsed: false
+  Time:
+    collapsed: false
+  Tool Properties:
+    collapsed: false
+  Views:
+    collapsed: true
+  Width: 1600
+  X: 0
+  Y: 204

+ 15 - 0
src/robot_description/launch/display.launch

@@ -0,0 +1,15 @@
+<launch>
+  <arg name="model" />
+  <arg name="gui" default="False" />
+
+  <param
+    name="robot_description"
+    textfile="$(find robot_description)/urdf/robot.urdf" />
+  <param name="use_gui" value="$(arg gui)" />
+  <node
+    name="rviz"
+    pkg="rviz"
+    type="rviz"
+    args="-d $(find robot_description)/config/urdf.rviz" />
+</launch>
+

+ 30 - 0
src/robot_description/launch/robot_description.launch

@@ -0,0 +1,30 @@
+<!--
+  Author: www.corvin.cn
+  Description:配置机器人各link之间关系,在rviz中显示机器人模型.
+  History:
+    20190716:init this launch file.
+ -->
+<launch>
+  <arg name="model" />
+
+  <arg name="gui" default="False" />
+  <param
+    name="robot_description"
+    textfile="$(find robot_description)/urdf/robot.urdf" />
+  <param name="use_gui" value="$(arg gui)" />
+
+  <node
+    name="joint_state_publisher"
+    pkg="joint_state_publisher"
+    type="joint_state_publisher">
+    <param name="rate" value="10.0" />
+  </node>
+
+  <node
+    name="robot_state_publisher"
+    pkg="robot_state_publisher"
+    type="state_publisher" >
+    <param name="publish_frequency" value="20.0"/>
+  </node>
+</launch>
+

BIN
src/robot_description/meshes/base_link.STL


BIN
src/robot_description/meshes/rplidar_a2.STL


BIN
src/robot_description/meshes/x2l_lidar.STL


+ 21 - 0
src/robot_description/package.xml

@@ -0,0 +1,21 @@
+<package>
+  <name>robot_description</name>
+  <version>1.0.0</version>
+  <description>
+    <p>URDF Description package for carebot_description</p>
+    <p>This package contains configuration data, 3D models and launch files
+for robot_description robot</p>
+  </description>
+  <author>me</author>
+  <maintainer email="corvin_zhang@corvin.cn" />
+  <license>BSD</license>
+  <buildtool_depend>catkin</buildtool_depend>
+  <build_depend>roslaunch</build_depend>
+  <run_depend>robot_state_publisher</run_depend>
+  <run_depend>rviz</run_depend>
+  <run_depend>joint_state_publisher</run_depend>
+  <run_depend>gazebo</run_depend>
+  <export>
+    <architecture_independent />
+  </export>
+</package>

+ 57 - 0
src/robot_description/urdf/common_properties.urdf.xacro

@@ -0,0 +1,57 @@
+<?xml version="1.0" ?>
+<!--
+  Various useful properties such as constants and materials 
+ -->
+<robot name="xacro_properties" xmlns:xacro="http://ros.org/wiki/xacro">
+  <xacro:property name="M_PI" value="3.1415926535897931" /> 
+  <xacro:property name="material_white">
+    <material name="white">
+      <color rgba="1 1 1 1"/>
+    </material>
+  </xacro:property>
+  <xacro:property name="material_grey">
+    <material name="grey">
+      <color rgba="0.5 0.5 0.5 1"/>
+    </material>
+  </xacro:property>
+  <xacro:property name="material_light_grey">
+    <material name="light_grey">
+      <color rgba="0.6 0.6 0.6 1"/>
+    </material>
+  </xacro:property>
+  <xacro:property name="material_dark_grey">
+    <material name="dark_grey">
+      <color rgba="0.3 0.3 0.3 1"/>
+    </material>
+  </xacro:property>
+  <xacro:property name="material_black">
+    <material name="black">
+      <color rgba="0.1 0.1 0.1 1"/>
+    </material>
+  </xacro:property>
+  <xacro:property name="material_red">
+    <material name="red">
+      <color rgba="1 0 0 1"/>
+    </material>
+  </xacro:property>
+  <xacro:property name="material_green">
+    <material name="green">
+      <color rgba="0.0 0.8 0.0 1"/>
+    </material>
+  </xacro:property>
+  <xacro:property name="material_blue">
+    <material name="blue">
+      <color rgba="0.0 0.0 1.0 1"/>
+    </material>
+  </xacro:property>
+  <xacro:property name="material_grey_blue">
+    <material name="grey_blue">
+      <color rgba="0.4 0.4 1.0 1"/>
+    </material>
+  </xacro:property>
+  <xacro:property name="material_orange">
+    <material name="orange">
+      <color rgba="1.0 0.7 0.0 1"/>
+    </material>
+  </xacro:property>
+</robot>

+ 113 - 0
src/robot_description/urdf/robot.urdf

@@ -0,0 +1,113 @@
+<robot name="robot">
+  <material name="blue">
+    <color rgba="0.1 0.1 0.75 0.9"/>
+  </material>
+
+  <link name="base_link">
+    <inertial>
+      <origin
+        xyz="-0.00915640899856677 -1.23594917594765E-18 0.116771439156292"
+        rpy="0 0 0" />
+      <mass
+        value="1.53513901604802" />
+      <inertia
+        ixx="0.0429859907839231"
+        ixy="1.40607469244214E-18"
+        ixz="0.00161915133178891"
+        iyy="0.0421680076448672"
+        iyz="-2.37846851589008E-18"
+        izz="0.0250023780420302" />
+    </inertial> 
+    <visual>
+      <origin
+        xyz="0 0 0"
+        rpy="0 0 0" />
+      <geometry>
+        <mesh filename="package://robot_description/meshes/base_link.STL" />
+      </geometry>
+      <material
+        name="">
+        <color rgba="0.792156862745098 0.819607843137255 0.933333333333333 1" />
+      </material>
+    </visual>
+    <collision>
+      <origin
+        xyz="0 0 0"
+        rpy="0 0 0" />
+      <geometry>
+        <mesh filename="package://robot_description/meshes/base_link.STL" />
+      </geometry>
+    </collision>
+  </link>
+
+  <link name="base_footprint">
+    <visual>
+        <geometry>
+          <box size="0.005 0.005 0.005" />
+        </geometry>
+    </visual>
+  </link>
+  <joint name="base_footprint_joint" type="fixed">
+    <origin xyz="0 0 0.05"/>
+    <parent link="base_footprint"/>
+    <child link="base_link"/>
+  </joint>
+
+  <link name="base_imu_link" type="fixed">
+    <visual>
+      <geometry>
+        <box size="0.056 0.065 0.002" />
+      </geometry>
+        <material name="blue" />
+    </visual>
+  </link>
+  <joint name="base_link_to_IMU" type="fixed">
+    <origin xyz="0 0 0.10" />
+    <parent link="base_link" />
+    <child link="base_imu_link" />
+  </joint>
+
+  <link name="lidar" type="fixed">
+    <inertial>
+      <origin>
+        xyz="0 0 0"
+        rpy="0 0 0"
+      </origin>
+      <mass value="0.19" />
+      <inertia
+        ixx="0.0429859907839231"
+        ixy="1.40607469244214E-18"
+        ixz="0.00161915133178891"
+        iyy="0.0421680076448672"
+        iyz="-2.37846851589008E-18"
+        izz="0.0250023780420302" />
+    </inertial>
+    <visual>
+      <origin>
+        xyz="0 0 0"
+        rpy="1.57079 0 0"
+      </origin>
+      <geometry>
+        <cylinder length="0.0535" radius="0.03" />
+      </geometry>
+      <material name="">
+        <color rgba="0.79216 0.81961 0.9333 0.5" />
+      </material>
+    </visual>
+    <collision>
+      <origin>
+        xyz="0 0 0"
+        rpy="1.57.79 0 0"
+      </origin>
+      <geometry>
+        <cylinder length="0.042" radius="0.038" />
+      </geometry>
+    </collision>
+  </link>
+  <joint name="lidar_to_base" type="fixed">
+    <origin xyz="0 0 0.1817"/>
+    <parent link="base_link"/>
+    <child link="lidar"/>
+  </joint>
+
+</robot>

+ 15 - 0
src/robot_description/urdf/robot.xacro

@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<!--
+  Author: corvin
+  Description: this file is about robot description
+  Date: 20190722-init this description files;
+-->
+
+<robot name="robot" xmlns:xacro="http://ros.org/wiki/xacro">
+  <xacro:include filename="$(find robot_description)/urdf/common_properties.urdf.xacro" />
+  <xacro:property name="M_SCALE" value="0.001" />
+
+  <xacro:include filename="$(find robot_description)/urdf/robot_stack.xacro" />
+  <!--<xacro include filename="$(find robot_description)/urdf/rplidar_a2.urdf" />-->
+
+</robot>

+ 51 - 0
src/robot_description/urdf/robot_stack.xacro

@@ -0,0 +1,51 @@
+<?xml version="1.0"?>
+<!--
+  Author: corvin
+  Description: this is robot stack urdf file
+  Date: 20190722-init file;
+-->
+
+<robot name="robot" xmlns:xacro="http://ros.org/wiki/xacro">
+
+ <link name="base_footprint"/>
+    <!--
+       Base link is set at the bottom of the base mould.
+       This is done to be compatible with the way base link
+       was configured for turtlebot 1. Refer to
+
+       https://github.com/turtlebot/turtlebot/issues/40
+
+       To put the base link at the more oft used wheel
+       axis, set the z-distance from the base_footprint
+       to 0.352.
+      -->
+    <joint name="base_joint" type="fixed">
+      <origin xyz="0 0 0.0102" rpy="0 0 0" />
+      <parent link="base_footprint"/>
+      <child link="base_link" />
+    </joint>
+    <link name="base_link">
+      <visual>
+        <geometry>
+          <!-- new mesh -->
+          <mesh filename="package://robot_description/meshes/base_link.STL" />
+        </geometry>
+        <origin xyz="0.001 0 0.05199" rpy="0 0 0"/>
+      </visual>
+      <collision name="base">
+        <geometry>
+          <cylinder length="0.10938" radius="0.178"/>
+        </geometry>
+        <origin xyz="0.0 0 0.05949" rpy="0 0 0"/>
+      </collision>
+      <inertial>
+        <!-- COM experimentally determined -->
+        <origin xyz="0.01 0 0"/>
+        <mass value="2.4"/> <!-- 2.4/2.6 kg for small/big battery pack -->
+        <inertia ixx="0.019995" ixy="0.0" ixz="0.0"
+                 iyy="0.019995" iyz="0.0"
+                 izz="0.03675" />
+      </inertial>
+    </link>
+
+</robot>