Ackermann Car Simulation with 3D Velodyne Lidar in Gazebo Environment.
$ mkdir ws/src -p
$ cd ws/src
$ git clone --recursive https://github.com/CihatAltiparmak/car_sim.git
$ cd ..
$ source /opt/ros/foxy/setup.bash
$ colcon build
$ source install/setup.bash
Firstly, run launch file
$ ros2 launch car_sim_gazebo world.launch.py extra_gazebo_args:="--verbose" gpu:=true
In another shell, you can control velocity and steering angle of the car by publishing AckermannDriveStamped ros2 message.
Warning: Steering angle is in radyan type, not in degree.
$ ros2 topic pub --once /itusct/command_cmd ackermann_msgs/msg/AckermannDriveStamped "header:
stamp:
sec: 0
nanosec: 0
frame_id: ''
drive:
steering_angle: 0.1
steering_angle_velocity: 0.0
speed: 5.0
acceleration: 0.0
jerk: 0.0"
Run executable file in car_sim_gazebo
$ ros2 run car_sim_gazebo teleop_keyboard.py
After running teleop_keyboard.py
, you can control the car with keys w
, a
, s
, d
, x
. Inspired by teleop_twist_keyboard ros package.
w
-> increases the car's speed.
x
-> decreases the car's speed. (if speed of the car is negative, car start to go backward.)
a
-> increases the car's steering angle
d
-> decreases the car's steering angle
s
-> stops the car and zeros the car's steering angle
gazebo_ros_ackermann_drive plugin
Bosch Future Mobility Challenge Simulator Codes
SD TwizyModel Description Files
yukkysaito/car_demo plugin file
This repo is under MIT LICENSE
- Add car control option based on acceleration and angular velocity
- Add brake system
- Provide car control options for simulation to user.
- Improve PID. Provide better PID parameters for linear velocity control and steering degree control. (Parameters are found by trial and error method.)
- Add IMU sensor
- Add GPS sensor
- Any innovative idea.