Skip to content

CihatAltiparmak/car_sim

Repository files navigation

CarSimulation

love

Summary

Ackermann Car Simulation with 3D Velodyne Lidar in Gazebo Environment.

car_sim

Installation

$ 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

How To Use

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"

gazebo_world

Control By Keyboard

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

Useful Links

gazebo_ros_ackermann_drive plugin

Bosch Future Mobility Challenge Simulator Codes

Audibot Car Plugin

SD TwizyModel Description Files

SD TwizyModel Plugin

yukkysaito/car_demo plugin file

Audibot Car Description File

License

This repo is under MIT LICENSE

CONTRIBUTORS

GitHub Contributors Image

TODO

  • 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.

Thanks To

robustify/audibot

streetdrone-home/SD-TwizyModel

yukkysaito/car_demo

ECC-BFMC/Simulator