Skip to content

Gazebo simulation + RVIZ data visualization to test tractor code

Notifications You must be signed in to change notification settings

olinrobotics/tractor_sim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tractor_sim

Package for simulating the Olin Robotics Lab Autonomous Tractor. For further project information, see the GRAVL main repository wiki: (link)

Setup

Dependencies:

Installation:

  • cd ~/catkin_ws/src
  • git clone https://github.com/olinrobotics/tractor_sim.git
  • cd ..
  • rosdep install -iry --from-paths src
  • cd ~/catkin_ws/
  • catkin_make

To use the models included in this repo, copy the contents of the folder to ~/.gazebo/models

  • cd ~/catkin_ws/src/tractor_sim/tractor_sim_gazebo/models
  • cp -R . ~/.gazebo/models

Usage

To run simulation:

  • roslaunch tractor_sim_gazebo bringup.launch

ROS Topics

  • /cmd_vel - twist command for driving the tractor
  • /cmd_hitch - pose command for setting height of box blade (reference)

Sensor Topics

  • /camera/image_raw - camera feed
  • /gps/fix - rtk gps data
  • /imu/data - imu data
  • /scan - downward facing LiDar data

Other Topics

  • /odometry/filtered - tractor odometry
  • /laser_pointcloud - generated pointcloud

Troubleshooting

If using the main launch file doesn't work for you, you can just run individual launch files to suit your needs To run simulation without external dependencies:

  • roslaunch tractor_sim_gazebo bringup_min.launch

To run rviz:

  • roslaunch tractor_sim_description tractor_sim_rviz.launch

To test code:

  • rosrun gravl yourscript.py (ex: rosrun gravl LidarFollower.py)

To run simulation (without teleop, hitch controls, localization, or any extra code running)

  • roslaunch tractor_sim_gazebo tractor_sim.launch

To run teleop (following https://github.com/olinrobotics/gravl/wiki/Kubo:-Overview):

  • roslaunch gravl teleop.launch
  • roslaunch gravl mainstate.launch

To setup localization:

  • roslaunch gravl localization.launch

To setup hitch commands:

  • roslaunch tractor_sim_gazebo hitch.launch

Parameters

  • tractor_delay - either 0 or 1. If set to 1, then tractor will react instantaneously to commands. If set to 1, the tractor will simulate the delayed response time of the real tractor (Default: 1)
  • max_acceleration - maximum acceleration for the tractor Note: only works when tractor_delay is 0 (Default: 0.4)
  • max_steering_angle_velocity - maximum steering velocity Note: only works when tractor_delay is set to 0 (Default: 1)

Known Issues

  • Running the launch file will throw the warning
[WARN] [1590601461.920958, 0.000000]: Controller Spawner couldn't find the expected controller_manager ROS interface.

if the controller spawner loads before gazebo loads, which is likely. To get around this, in the launch file the controller spawner's node has respawn="true". Ideally, this should wait for gazebo to finish loading before starting the node so that the warning doesn't pop up, but this works for now.

About

Gazebo simulation + RVIZ data visualization to test tractor code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •