Giter VIP home page Giter VIP logo

vehicle_simulator's Introduction

Vehicle Simulator

This repository constains a vehicle simulator for use in Gazebo. The simulator is based on drcsim developed by OSRF. Drcsim focused on the simulation of Boston Dynamics Atlas robot for the DARPA Robotics Challenge and the vehicle simulation is only a small part of the package for the vehicle task. This project tries to reuse this part of code. The goal is to create a complete simulation package for research on autonomous vehicles.

1. Simulation Setup

Assume your catkin worksapce locates at $HOME/Workspace/catkin_ws.

$ cd ~/Workspace/catkin_ws
$ wstool init src
$ cd ~/Workspace/catkin_ws/src
$ wstool set vehicle_simulator https://github.com/rxdu/vehicle_simulator.git --git
$ wstool update

You need to set a few environment variables so that Gazebo could find vehicle models and plugins properly. Put the following two lines in your ~/.bashrc

export GAZEBO_PLUGIN_PATH=$HOME/Workspace/catkin_ws/devel/lib/:$GAZEBO_PLUGIN_PATH
export GAZEBO_MODEL_PATH=$HOME/Workspace/catkin_ws/src/vehicle_simulator/vehicle_description/models:$GAZEBO_MODEL_PATH

Note: You need to adjust the path according the configurations on your computer.

2. Basic testing commands

You can start a simulation with a drc_vehicle or drc_vehicle_xp900 in an empty world using the following commands:

$ roslaunch vehiclesim_gazebo drc_vehicle.launch

or

$ roslaunch vehiclesim_gazebo drc_vehicle_xp900.launch

Turn the steering wheel to the left:

$ rostopic pub --once /drc_vehicle/hand_wheel/cmd std_msgs/Float64 '{ data : 3.14 }'

Turn the steering wheel to the right:

$ rostopic pub --once /drc_vehicle/hand_wheel/cmd std_msgs/Float64 '{ data : -3.14 }'

Press the gas pedal:

$ rostopic pub --once /drc_vehicle/gas_pedal/cmd std_msgs/Float64 '{ data : 1 }'

Disengage hand brake :

$ rostopic pub --once /drc_vehicle/hand_brake/cmd std_msgs/Float64 '{ data : 0 }'

Turn the engine off:

$ rostopic pub --once /drc_vehicle/key/cmd std_msgs/Int8 '{ data : 0 }'

Note: You need to change the topic name "drc_vehicle" to "drc_vehicle_xp900" if you're using xp900 model.

3. Issues and Solutions

  • No namespace found

This issue is due to missing "~/.gazebo/models" folder.

$ cd ~
$ wget -r -R "index\.html*" http://models.gazebosim.org/
$ cd models.gazebosim.org
$ mv * ~/.gazebo/models

Reference

vehicle_simulator's People

Contributors

rxdu avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

xiaohuixxtian

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.