-
Notifications
You must be signed in to change notification settings - Fork 41
/
andino.gazebo.xacro
169 lines (154 loc) · 5.48 KB
/
andino.gazebo.xacro
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="andino">
<xacro:include filename="$(find andino_description)/urdf/andino.urdf.xacro"/>
<xacro:macro name="friction" params="reference mu">
<gazebo reference="${reference}">
<mu1>${mu}</mu1>
<mu2>${mu}</mu2>
<kp>1000000.0</kp>
<kd>1.0</kd>
<minDepth>0.0001</minDepth>
<maxVel>1.0</maxVel>
</gazebo>
</xacro:macro>
<xacro:friction reference="front_right_wheel" mu="100.0"/>
<xacro:friction reference="front_left_wheel" mu="100.0"/>
<xacro:friction reference="caster_wheel_link" mu="0.05"/>
<!--TODO(olmerg) initial solution problem with ros control -->
<!-- <xacro:friction reference="caster_rotation_link" mu="0.0"/> -->
<xacro:if value="$(arg use_gazebo_ros_control)">
<ros2_control name="diff_controller" type="system">
<hardware>
<plugin>gazebo_ros2_control/GazeboSystem</plugin>
</hardware>
<joint name="left_wheel_joint">
<command_interface name="velocity">
<param name="min">-5</param>
<param name="max">5</param>
</command_interface>
<state_interface name="velocity"/>
<state_interface name="position"/>
</joint>
<joint name="right_wheel_joint">
<command_interface name="velocity">
<param name="min">-5</param>
<param name="max">5</param>
</command_interface>
<state_interface name="velocity"/>
<state_interface name="position"/>
</joint>
</ros2_control>
<gazebo>
<plugin filename="libgazebo_ros2_control.so" name="gazebo_ros2_control">
<parameters>$(find andino_control)/config/andino_controllers.yaml</parameters>
</plugin>
<plugin name="andino_joint_state_caster" filename="libgazebo_ros_joint_state_publisher.so">
<ros>
<remapping>~/out:=joint_states</remapping>
<remapping>/tf:=tf</remapping>
</ros>
<update_rate>10</update_rate>
<joint_name>caster_wheel_joint</joint_name>
</plugin>
</gazebo>
</xacro:if>
<xacro:unless value="$(arg use_gazebo_ros_control)">
<gazebo>
<plugin name="andino_joint_state" filename="libgazebo_ros_joint_state_publisher.so">
<ros>
<remapping>~/out:=joint_states</remapping>
<remapping>/tf:=tf</remapping>
</ros>
<update_rate>10</update_rate>
<joint_name>right_wheel_joint</joint_name>
<joint_name>left_wheel_joint</joint_name>
<joint_name>caster_wheel_joint</joint_name>
</plugin>
<plugin name='andino_diff_drive' filename='libgazebo_ros_diff_drive.so'>
<ros>
<remapping>odom:=odom</remapping>
<remapping>/tf:=tf</remapping>
</ros>
<!-- wheels -->
<left_joint>left_wheel_joint</left_joint>
<right_joint>right_wheel_joint</right_joint>
<!-- kinematics -->
<wheel_separation>0.137</wheel_separation>
<wheel_diameter>0.035</wheel_diameter>
<!-- limits -->
<max_wheel_torque>20</max_wheel_torque>
<max_wheel_acceleration>1</max_wheel_acceleration>
<!-- output -->
<publish_odom>true</publish_odom>
<publish_odom_tf>true</publish_odom_tf>
<odometry_frame>odom</odometry_frame>
<robot_base_frame>base_link</robot_base_frame>
</plugin>
</gazebo>
</xacro:unless>
<gazebo reference="rplidar_laser_link">
<sensor name="sensor_ray_front" type="ray">
<ray>
<scan>
<horizontal>
<samples>720</samples>
<resolution>1</resolution>
<min_angle>-3.14159265</min_angle>
<max_angle>3.14159265</max_angle>
</horizontal>
</scan>
<range>
<min>0.10</min>
<max>12.0</max>
<resolution>0.01</resolution>
</range>
<noise>
<type>gaussian</type>
<mean>0.0</mean>
<stddev>0.01</stddev>
</noise>
</ray>
<always_on>true</always_on>
<visualize>true</visualize>
<update_rate>20.0</update_rate>
<plugin name="sensor_laser_front" filename="libgazebo_ros_ray_sensor.so">
<ros>
<remapping>~/out:=scan</remapping>
</ros>
<frame_name>rplidar_laser_link</frame_name>
<output_type>sensor_msgs/LaserScan</output_type>
</plugin>
</sensor>
</gazebo>
<gazebo reference="camera_link">
<sensor name='camera' type='camera'>
<camera>
<horizontal_fov>1.047</horizontal_fov>
<image>
<width>640</width>
<height>480</height>
</image>
<clip>
<near>0.1</near>
<far>100</far>
</clip>
</camera>
<always_on>1</always_on>
<update_rate>30</update_rate>
<plugin name='camera_controller' filename='libgazebo_ros_camera.so'>
<alwaysOn>1</alwaysOn>
<cameraName>camera</cameraName>
<imageTopicName>image_raw</imageTopicName>
<cameraInfoTopicName>camera_info</cameraInfoTopicName>
<frameName>camera_link</frameName>
<hackBaseline>0.07</hackBaseline>
<distortionK1>0.0</distortionK1>
<distortionK2>0.0</distortionK2>
<distortionK3>0.0</distortionK3>
<distortionT1>0.0</distortionT1>
<distortionT2>0.0</distortionT2>
</plugin>
</sensor>
</gazebo>
<xacro:include filename="$(find andino_gazebo)/urdf/include/andino_materials.xacro"/>
</robot>