Skip to content

Instantly share code, notes, and snippets.

@hdd-robot
Created April 17, 2019 17:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hdd-robot/2d334c53aaa3b7366b96249964bbfead to your computer and use it in GitHub Desktop.
Save hdd-robot/2d334c53aaa3b7366b96249964bbfead to your computer and use it in GitHub Desktop.
Robot description files
vica_robot_controller:
type : "diff_drive_controller/DiffDriveController"
left_wheel : 'l_wheel_joint'
right_wheel : 'r_wheel_joint'
pid: {p: 100.0, i: 0.01, d: 10.0}
publish_rate: 100.0 # default: 50
pose_covariance_diagonal : [0.001, 0.001, 1000000.0, 1000000.0, 1000000.0, 1000.0]
twist_covariance_diagonal: [0.001, 0.001, 1000000.0, 1000000.0, 1000000.0, 1000.0]
# Wheel separation and diameter. These are both optional.
# diff_drive_controller will attempt to read either one or both from the
# URDF if not specified as a parameter
wheel_separation : 0.22
wheel_radius : 0.06
# Wheel separation and radius multipliers
wheel_separation_multiplier: 1.0 # default: 1.0
wheel_radius_multiplier : 1.0 # default: 1.0
# Velocity commands timeout [s], default 0.5
cmd_vel_timeout: 0.5
# Base frame_id
base_frame_id: base_link #default: base_link
# Velocity and acceleration limits
# Whenever a min_* is unspecified, default to -max_*
linear:
x:
has_velocity_limits : true
max_velocity : 0.4 # m/s
min_velocity : -0.4 # m/s
has_acceleration_limits: true
max_acceleration : 0.2 # m/s^2
min_acceleration : -0.2 # m/s^2
angular:
z:
has_velocity_limits : true
max_velocity : 0.6 # rad/s
has_acceleration_limits: true
max_acceleration : 0.4 # rad/s^2
joint_read_state_controller:
type: joint_state_controller/JointStateController
publish_rate: 100.0
#Publish to TF directly or not
enable_odom_tf: true
#Name of frame to publish odometry in
odom_frame_id: odom
# Publish the velocity command to be executed.
# It is to monitor the effect of limiters on the controller input.
publish_cmd: true
<?xml version="1.0"?>
<robot name="ubot" xmlns:xacro="http://www.ros.org/wiki/xacro">
<xacro:include filename="$(find vica_robot)/urdf/robot.gazebo" />
<xacro:include filename="$(find vica_robot)/urdf/materials.xacro" />
<xacro:include filename="$(find vica_robot)/urdf/macros.xacro" />
<robotBaseFrame>base_link</robotBaseFrame>
<link name="base_link">
<visual>
<origin rpy="0 0 0" xyz="0 0 0.01" />
<geometry>
<mesh scale=".0010 .0010 .0010" filename="package://vica_robot/meshes/base.stl" />
</geometry>
<material name="Yellow">
<color rgba="1 1 0 1" />
</material>
</visual>
<collision>
<origin rpy="0 0 0" xyz="0 0 0.01" />
<geometry>
<mesh scale=".0010 .0010 .0010" filename="package://vica_robot/meshes/base.stl" />
</geometry>
</collision>
<inertial>
<mass value="5.76" />
<inertia ixx="0.88" ixy="0" ixz="0" iyy="1.0" iyz="0" izz="0.88" />
</inertial>
<visual name='caster_visual_front'>
<origin xyz="-0.135 0.00 0.0035" rpy="0 0 0" />
<geometry>
<sphere radius="0.00339" />
</geometry>
</visual>
<collision name='caster_collision_front'>
<origin xyz="-0.135 0.00 0.0035" rpy="0 0 0" />
<geometry>
<sphere radius="0.00339" />
</geometry>
<surface>
<friction>
<ode>
<mu>0</mu>
<mu2>0</mu2>
<slip1>1.0</slip1>
<slip2>1.0</slip2>
</ode>
</friction>
</surface>
</collision>
<visual name='caster_visual_back'>
<origin xyz="0.135 0.00 0.0035" rpy="0 0 0" />
<geometry>
<sphere radius="0.00339" />
</geometry>
</visual>
<collision name='caster_collision_back'>
<origin xyz="0.135 0.00 0.0035" rpy="0 0 0" />
<geometry>
<sphere radius="0.00339" />
</geometry>
<surface>
<friction>
<ode>
<mu>0</mu>
<mu2>0</mu2>
<slip1>1.0</slip1>
<slip2>1.0</slip2>
</ode>
</friction>
</surface>
</collision>
</link>
<link name="r_wheel">
<visual>
<origin rpy="0 0 1.57079632679" xyz="0 0 0" />
<geometry>
<mesh scale=".0010 .0010 .0010" filename="package://vica_robot/meshes/rwheel.stl" />
</geometry>
<material name="Blue">
<color rgba="0 1 1 1" />
</material>
</visual>
<collision>
<origin rpy="0 0 1.57079632679" xyz="0 0 0" />
<geometry>
<mesh scale=".0010 .0010 .0010" filename="package://vica_robot/meshes/rwheel.stl" />
</geometry>
<surface>
<friction>
<ode>
<mu>100</mu>
<mu2>100</mu2>
</ode>
</friction>
</surface>
</collision>
<inertial>
<mass value="0.181" />
<cylinder_inertia m="5" r="0.1" h="0.05" />
<inertia ixx="0.89" ixy="0" ixz="0" iyy="1.0" iyz="0" izz="0.88" />
</inertial>
</link>
<link name="l_wheel">
<visual>
<origin rpy="0 0 1.57079632679" xyz="0 0 0" />
<geometry>
<mesh scale=".0010 .0010 .0010" filename="package://vica_robot/meshes/lwheel.stl" />
</geometry>
<material name="Blue">
<color rgba="0 1 1 1" />
</material>
</visual>
<collision>
<origin rpy="0 0 1.57079632679" xyz="0 0 0" />
<geometry>
<mesh scale=".0010 .0010 .0010" filename="package://vica_robot/meshes/lwheel.stl" />
</geometry>
<surface>
<friction>
<ode>
<mu>100</mu>
<mu2>100</mu2>
</ode>
</friction>
</surface>
</collision>
<inertial>
<mass value="0.181" />
<cylinder_inertia m="5" r="0.1" h="0.05" />
<inertia ixx="0.88" ixy="0" ixz="0" iyy="1.0" iyz="0" izz="0.88" />
</inertial>
</link>
<link name="kinect">
<visual>
<origin rpy="0 0 0" xyz="0 0 0" />
<geometry>
<mesh scale=".0010 .0010 .0010" filename="package://vica_robot/meshes/kinect.stl" />
</geometry>
<material name="Red">
<color rgba="1 0 0 1" />
</material>
</visual>
<collision>
<geometry>
<mesh scale=".0010 .0010 .0010" filename="package://vica_robot/meshes/kinect.stl" />
</geometry>
</collision>
<inertial>
<mass value="0.681" />
<inertia ixx="0.89" ixy="0" ixz="0" iyy="1.0" iyz="0" izz="0.89" />
</inertial>
</link>
<link name="rplidar">
<visual>
<origin rpy="1.57079632679 0 0" xyz="0 0 -0.04" />
<geometry>
<mesh scale=".0010 .0010 .0010" filename="package://vica_robot/meshes/rplidar.stl" />
</geometry>
<material name="Red">
<color rgba="1 0 0 1" />
</material>
</visual>
<collision>
<geometry>
<mesh scale=".0010 .0010 .0010" filename="package://vica_robot/meshes/rplidar.stl" />
</geometry>
</collision>
<inertial>
<mass value="0.681" />
<inertia ixx="0.89" ixy="0" ixz="0" iyy="1.0" iyz="0" izz="0.89" />
</inertial>
</link>
<joint name="r_wheel_joint" type="continuous">
<parent link="base_link" />
<child link="r_wheel" />
<origin xyz="0 -0.15 0.0325" rpy="0 0 1.57079632679" />
</joint>
<transmission name="r_wheel_transmission">
<type>transmission_interface/SimpleTransmission</type>
<joint name="r_wheel_joint">
<hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
</joint>
<actuator name="r_wheel_actuator">
<mechanicalReduction>7</mechanicalReduction>
<hardwareInterface>VelocityJointInterface</hardwareInterface>
</actuator>
</transmission>
<joint name="l_wheel_joint" type="continuous">
<parent link="base_link" />
<child link="l_wheel" />
<origin xyz="0 0.15 0.0325" rpy="0 0 1.57079632679" />
</joint>
<transmission name="l_wheel_transmission">
<type>transmission_interface/SimpleTransmission</type>
<joint name="l_wheel_joint">
<hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
</joint>
<actuator name="l_wheel_actuator">
<mechanicalReduction>7</mechanicalReduction>
<hardwareInterface>VelocityJointInterface</hardwareInterface>
</actuator>
</transmission>
<joint name="kinect_joint" type="fixed">
<parent link="base_link" />
<child link="kinect" />
<origin xyz="0.055 -0.02 0.147" rpy="0 0 0" />
</joint>
<joint name="rplidar_joint" type="fixed">
<parent link="base_link" />
<child link="rplidar" />
<origin xyz="-0.06 0.033 0.28" rpy="0 0 0" />
</joint>
</robot>
<?xml version="1.0"?>
<robot>
<!-- SENSOR -->
<gazebo reference="kinect">
<sensor type="depth" name="openni_camera_camera">
<always_on>true</always_on>
<visualize>true</visualize>
<camera>
<pose>0 0 1 0 0 0</pose>
<horizontal_fov>1.047</horizontal_fov>
<image>
<width>640</width>
<height>480</height>
<format>R8G8B8</format>
</image>
<depth_camera>
</depth_camera>
<clip>
<near>0.1</near>
<far>100</far>
</clip>
</camera>
<plugin name="camera_controller" filename="libgazebo_ros_openni_kinect.so">
<alwaysOn>true</alwaysOn>
<updateRate>40.0</updateRate>
<cameraName>vica_robot/sensor/kinect</cameraName>
<frameName>kinect_real_pos</frameName>
<imageTopicName>rgb/image_raw</imageTopicName>
<depthImageTopicName>depth/image_raw</depthImageTopicName>
<pointCloudTopicName>depth/points</pointCloudTopicName>
<cameraInfoTopicName>rgb/camera_info</cameraInfoTopicName>
<depthImageCameraInfoTopicName>vica_robot/sensor/depth/camera_info
</depthImageCameraInfoTopicName>
<pointCloudCutoff>0.4</pointCloudCutoff>
<hackBaseline>0.07</hackBaseline>
<distortionK1>0.0</distortionK1>
<distortionK2>0.0</distortionK2>
<distortionK3>0.0</distortionK3>
<distortionT1>0.0</distortionT1>
<distortionT2>0.0</distortionT2>
<CxPrime>0.0</CxPrime>
<Cx>0.0</Cx>
<Cy>0.0</Cy>
<focalLength>0.0</focalLength>
</plugin>
</sensor>
</gazebo>
<!-- RPLIDAR -->
<gazebo reference="rplidar">
<sensor type="gpu_ray" name="rplidar_laser">
<visualize>false</visualize>
<pose>0 0 0 0 0 0</pose>
<update_rate>40</update_rate>
<ray>
<scan>
<horizontal>
<samples>720</samples>
<resolution>1</resolution>
<min_angle>-3.14159265359</min_angle>
<max_angle>3.14159265359</max_angle>
</horizontal>
</scan>
<range>
<min>0.10</min>
<max>5.0</max>
<resolution>0.01</resolution>
</range>
<noise>
<type>gaussian</type>
<mean>0.0</mean>
<stddev>0.01</stddev>
</noise>
</ray>
<plugin name="hokuyo_node" filename="libgazebo_ros_gpu_laser.so">
<alwaysOn>true</alwaysOn>
<topicName>/vica_robot/sensor/laser/scan</topicName>
<frameName>/rplidar_real_pos</frameName>
</plugin>
</sensor>
</gazebo>
<gazebo>
<plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
<legacyModeNS>true</legacyModeNS>
</plugin>
</gazebo>
</robot>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment