Skip to content

Commit 3b8802b

Browse files
committed
Improve ackermann car
1 parent 0d524c8 commit 3b8802b

1 file changed

Lines changed: 59 additions & 86 deletions

File tree

  • CustomRobots/ackermann_cars/models/f1_renault_camera

CustomRobots/ackermann_cars/models/f1_renault_camera/model.sdf

Lines changed: 59 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<sdf version="1.6">
33

4-
<model name="f1_renault_ackermann_harmonic_laser">
4+
<model name="f1_renault_ackermann">
55
<pose>0 0 0.0 0 0 0</pose>
66

77
<link name='base_link'>
@@ -45,17 +45,6 @@
4545
<uri>model://f1_renault_camera/Renault/chasis.dae</uri>
4646
</mesh>
4747
</geometry>
48-
<surface>
49-
<contact>
50-
<ode />
51-
</contact>
52-
<friction>
53-
<ode>
54-
<mu>0.2</mu>
55-
<mu2>0.2</mu2>
56-
</ode>
57-
</friction>
58-
</surface>
5948
</collision>
6049
<visual name='chassis_link_fixed_joint_lump__chassis_link_visual'>
6150
<!-- <pose>0 1.51 0 0 -0 1.5708</pose> -->
@@ -100,18 +89,16 @@
10089
<izz>1.04961</izz>
10190
</inertia>
10291
</inertial>
103-
<collision name='bl_1_collision'>
104-
<pose>0.175 0.20252 0.028 0 -0 0</pose>
92+
93+
<collision name="bl_1_collision">
94+
<pose>0 0 0 0 1.57 0</pose>
10595
<geometry>
106-
<mesh>
107-
<scale>0.0002 0.0002 0.0002</scale>
108-
<uri>model://f1_renault_camera/Renault/bl_1.stl</uri>
109-
</mesh>
96+
<cylinder>
97+
<radius>0.065</radius>
98+
<length>0.05</length>
99+
</cylinder>
110100
</geometry>
111101
<surface>
112-
<contact>
113-
<ode />
114-
</contact>
115102
<friction>
116103
<ode>
117104
<mu>1.7</mu>
@@ -120,8 +107,10 @@
120107
</friction>
121108
</surface>
122109
</collision>
110+
123111
<visual name='bl_1_visual'>
124112
<!-- <pose>0.875 1.0136 0.1444 0 -0 0</pose> -->
113+
125114
<pose>0.175 0.028 -0.20252 0 -0 0</pose>
126115
<geometry>
127116
<mesh>
@@ -163,18 +152,16 @@
163152
<izz>1.04961</izz>
164153
</inertia>
165154
</inertial>
166-
<collision name='br_1_collision'>
167-
<pose>-0.175 0.20252 0.028 0 0 0</pose>
155+
156+
<collision name="br_1_collision">
157+
<pose>0 0 0 0 1.57 0</pose>
168158
<geometry>
169-
<mesh>
170-
<scale>0.0002 0.0002 0.0002</scale>
171-
<uri>model://f1_renault_camera/Renault/br_1.stl</uri>
172-
</mesh>
159+
<cylinder>
160+
<radius>0.065</radius>
161+
<length>0.05</length>
162+
</cylinder>
173163
</geometry>
174164
<surface>
175-
<contact>
176-
<ode />
177-
</contact>
178165
<friction>
179166
<ode>
180167
<mu>1.7</mu>
@@ -183,8 +170,10 @@
183170
</friction>
184171
</surface>
185172
</collision>
173+
186174
<visual name='br_1_visual'>
187175
<!-- <pose>-0.875 1.0136 0.1444 0 -0 0</pose> -->
176+
188177
<pose>-0.175 0.028 -0.20252 0 -0 0</pose>
189178
<geometry>
190179
<mesh>
@@ -194,7 +183,7 @@
194183
</geometry>
195184
</visual>
196185
<self_collide>0</self_collide>
197-
</link>
186+
</link>
198187

199188

200189
<!-- Steering Wheel -->
@@ -243,10 +232,10 @@
243232
</mesh>
244233
</geometry>
245234
</visual>
246-
<self_collide>1</self_collide>
235+
<self_collide>0</self_collide>
247236
</link>
248237

249-
238+
250239
<!-- Left Steering -->
251240
<!-- <joint name='l_steer' type='revolute'>
252241
<pose relative_to='chassis_link'>-0.825 1.51736 0.324997 0 -0 0</pose>
@@ -346,28 +335,27 @@
346335
<izz>1.04961</izz>
347336
</inertia>
348337
</inertial>
349-
<collision name='fl_1_collision'>
350-
<pose>0.175 -0.30348 0.02888 0 -0 0</pose>
338+
339+
<collision name="fl_1_collision">
340+
<pose>0 0 0 0 1.57 0</pose>
351341
<geometry>
352-
<mesh>
353-
<scale>0.0002 0.0002 0.0002</scale>
354-
<uri>model://f1_renault_camera/Renault/fl_1.stl</uri>
355-
</mesh>
342+
<cylinder>
343+
<radius>0.065</radius>
344+
<length>0.05</length>
345+
</cylinder>
356346
</geometry>
357347
<surface>
358-
<contact>
359-
<ode />
360-
</contact>
361348
<friction>
362349
<ode>
363-
<mu>1.1</mu>
364-
<mu2>1.1</mu2>
350+
<mu>1.7</mu>
351+
<mu2>1.7</mu2>
365352
</ode>
366353
</friction>
367354
</surface>
368355
</collision>
369356
<visual name='fl_1_visual'>
370357
<!-- <pose>0.875 -1.5174 0.1444 0 -0 0</pose> -->
358+
371359
<pose>0.175 0.02888 0.30348 0 -0 0</pose>
372360
<geometry>
373361
<mesh>
@@ -378,7 +366,7 @@
378366
</visual>
379367
<self_collide>0</self_collide>
380368
</link>
381-
369+
382370
<!-- Right Steering -->
383371
<!-- <joint name='r_steer' type='revolute'>
384372
<pose relative_to='chassis_link'>0.825 1.51736 0.324997 0 -0 0</pose>
@@ -443,18 +431,15 @@
443431
<izz>1.04961</izz>
444432
</inertia>
445433
</inertial>
446-
<collision name='fr_1_collision'>
447-
<pose>-0.175 -0.30348 0.02888 0 -0 0</pose>
434+
<collision name="fr_1_collision">
435+
<pose>0 0 0 0 1.57 0</pose>
448436
<geometry>
449-
<mesh>
450-
<scale>0.0002 0.0002 0.0002</scale>
451-
<uri>model://f1_renault_camera/Renault/fr_1.stl</uri>
452-
</mesh>
437+
<cylinder>
438+
<radius>0.065</radius>
439+
<length>0.05</length>
440+
</cylinder>
453441
</geometry>
454442
<surface>
455-
<contact>
456-
<ode />
457-
</contact>
458443
<friction>
459444
<ode>
460445
<mu>1.7</mu>
@@ -464,7 +449,6 @@
464449
</surface>
465450
</collision>
466451
<visual name='fr_1_visual'>
467-
<!-- <pose>-0.875 -1.5174 0.1444 0 -0 0</pose> -->
468452
<pose>-0.175 0.02888 0.30348 0 -0 0</pose>
469453
<geometry>
470454
<mesh>
@@ -474,7 +458,7 @@
474458
</geometry>
475459
</visual>
476460
</link>
477-
461+
478462
<link name="camera_link"/>
479463

480464
<link name="camera_rgb_frame">
@@ -491,29 +475,25 @@
491475
<mass>0.035</mass>
492476
</inertial>
493477

494-
<!-- OLD POSE -->
495-
<!-- <pose>0.0138 -0.0094 0.0214 0 0 0</pose> -->
496-
497-
<!-- NEW POSE -->
498478
<pose>0 2.7 0.2 0 0 1.57</pose>
499479

500480
<sensor name="camera" type="camera">
501481
<always_on>true</always_on>
502482
<visualize>true</visualize>
503-
<update_rate>30</update_rate>
483+
<update_rate>20.0</update_rate>
504484
<topic>/cam_f1_left/image_raw</topic>
505485
<gz_frame_id>camera_rgb_frame</gz_frame_id>
506-
<camera name="intel_realsense_r200">
486+
<camera name="cleft">
507487
<camera_info_topic>/cam_f1_left/camera_info</camera_info_topic>
508-
<horizontal_fov>1.02974</horizontal_fov>
488+
<horizontal_fov>1.570000</horizontal_fov>
509489
<image>
510-
<width>1920</width>
511-
<height>1080</height>
490+
<width>640</width>
491+
<height>480</height>
512492
<format>R8G8B8</format>
513493
</image>
514494
<clip>
515-
<near>0.02</near>
516-
<far>300</far>
495+
<near>0.100000</near>
496+
<far>15.000000</far>
517497
</clip>
518498
<noise>
519499
<type>gaussian</type>
@@ -523,7 +503,7 @@
523503
<mean>0.0</mean>
524504
<stddev>0.007</stddev>
525505
</noise>
526-
</camera>
506+
</camera>
527507
</sensor>
528508
</link>
529509

@@ -546,7 +526,7 @@
546526
</joint>
547527

548528
<!-- Gazebo Harmonic Plugins -->
549-
529+
550530
<!-- Ackermann Steering Plugin -->
551531
<plugin filename="gz-sim-ackermann-steering-system" name="gz::sim::systems::AckermannSteering">
552532
<left_joint>fl_axle</left_joint>
@@ -555,12 +535,14 @@
555535
<right_joint>br_axle</right_joint>
556536
<left_steering_joint>front_steering</left_steering_joint>
557537
<right_steering_joint>front_steering</right_steering_joint>
558-
<kingpin_width>1.65</kingpin_width>
559-
<steering_limit>0.3</steering_limit>
560-
<wheel_base>3.351</wheel_base>
561-
<wheel_separation>1.65</wheel_separation>
562-
<wheel_radius>0.3425</wheel_radius>
563-
<sub_topic>steer_angle</sub_topic>
538+
539+
<kingpin_width>0.32</kingpin_width>
540+
<steering_limit>0.52</steering_limit>
541+
542+
<wheel_base>0.6702</wheel_base>
543+
<wheel_separation>0.33</wheel_separation>
544+
<wheel_radius>0.0325</wheel_radius>
545+
564546
<min_velocity>-50</min_velocity>
565547
<max_velocity>50</max_velocity>
566548
<min_acceleration>-50</min_acceleration>
@@ -593,23 +575,14 @@
593575
<odom_topic>F1ROS/odom</odom_topic>
594576
<robot_base_frame>chassis_link</robot_base_frame>
595577
<odom_frame>odom</odom_frame>
596-
<odom_publish_frequency>50</odom_publish_frequency>
578+
<odom_publish_frequency>20</odom_publish_frequency>
597579
<dimensions>3</dimensions>
598580
</plugin>
599581

600-
<!-- Pose Publisher -->
601-
<plugin filename="gz-sim-pose-publisher-system" name="gz::sim::systems::PosePublisher">
602-
<publish_link_pose>true</publish_link_pose>
603-
<publish_collision_pose>false</publish_collision_pose>
604-
<publish_visual_pose>false</publish_visual_pose>
605-
<publish_nested_model_pose>true</publish_nested_model_pose>
606-
<update_frequency>50</update_frequency>
607-
</plugin>
608-
609582
<!-- Joint Position Controller for steering wheel (optional) -->
610583
<plugin filename="gz-sim-joint-position-controller-system" name="gz::sim::systems::JointPositionController">
611584
<joint_name>steering_joint</joint_name>
612-
<sub_topic>steering_wheel_cmd</sub_topic>
585+
<topic>/F1ROS/cmd_vel</topic>
613586
<p_gain>10</p_gain>
614587
<i_gain>0.1</i_gain>
615588
<d_gain>1</d_gain>

0 commit comments

Comments
 (0)