This mod for Farming Simulator 2019 allows autonomous driving of FarmSim vehicles with the ROS navigation stack.
The mod itself is hosted in this repository.
tud-cor/fs_mod_ros_windows contains the companion Python scripts which implement a bridge between modROS
and ROS 1 (using rospy
).
tud-cor/fs_mod_ros contains two example ROS packages which show how to interact with FarmSim19 running modROS
.
In its current state, modROS
publishes four types of messages:
rosgraph_msgs/Clock
: in-game simulated clock. This message stops being published when the game is paused/exitednav_msgs/Odometry
: ground-truthPose
andTwist
of vehicles based on their in-game position and orientationsensor_msgs/LaserScan
: data from five virtual laser scanners (parallel planes) (but see #10)sensor_msgs/Imu
: from a simulated IMU (but see #6)
In addition, there is preliminary support for input into Farming Simulator:
geometry_msgs/Twist
: controls the currently active vehicle (used by the demos in tud-cor/fs_mod_ros). Behaviour is similar to - but not identical to - a regular ROSTwist
interface to a vehicle (velocity mapping is not 1-to-1 yet due to how FarmSim controls vehicles)
Support for additional message types may be added in the future, but is limited by what the Farming Simulator Lua API exposes.
modROS
uses memory modification techniques which could be considered harmful by anti-cheat systems which are often included in games with on-line gameplay.
While the manifest clearly marks modROS
as incompatible with multiplayer game sessions, and the authors have not experienced any problems so far, we feel we must warn users and strongly recommend against ever trying to enable the mod in multiplayer games, nor run any of the scripts in tud-cor/fs_mod_ros_windows while playing on-line.
Users cannot hold the authors of modROS
responsible for loss of (on-line or other) functionality in Farming Simulator 19, nor for any damages related to or as a consequence of such loss of functionality.
Some parts are still under development.
- Windows 10
- Farming Simulator 19
Both the Steam version of Farming Simulator and the version distributed as a stand-alone purchase have been tested.
Note: The following instructions assume the default paths to various system folders are used on your machine. If not, please update the paths in the relevant places.
-
Clone the mod or download the
.zip
at any locationgit clone https://github.com/tud-cor/FS19_modROS modROS
-
Moving mod files to the
mods
directory: In order for FarmSim to detectmodROS
, you either have to move the folder modROS to themods
directory (%USERPROFILE%\Documents\My Games\FarmingSimulator2019\mods
) or create a symbolic link from themodROS
folder and drop it in theFarmingSimulator2019\mods
directory.The authors have used hardlinkshellext/linkshellextension which makes this an easy process.
-
If you've sucessfully installed the mod, it should be listed on the Installed tab of the Mods section in FarmSim (
modROS
is shown with a red square):More information on installing mods in Farming Simulator 2019 can be found here.
-
Enable the Developer Console in Farming Simulator. Tutorial can be found here.
To start transmitting messages between Farmsim and ROS, please first go to fs_mod_ros_windows.
If you would like to have a simulated RGB camera (not required to run navigation stack in ROS) in Farsmsim using screen capture, please refer to d3dshot_screen_grabber
To publish data, you need to first run a ROS node-all_in_one_publisher.py
. Please follow the instructions here.
Note: Before proceeding to the next step, make sure you see waiting for client from FarmSim19 in the cmd window
Open Farming Simulator 19 and switch the in-game console to command mode by pressing the tilde key (~) twice. More information on how to use console command in game can be found here.
To publish data, execute the following command in the FarmSim console:
rosPubMsg true
If you want to stop publishing data, simply execute:
rosPubMsg false
Please follow the instructions here to run the ROS node- cm_vel_subscriber.py
first.
To give control of the manned vehicle to ROS, execute the following command in the FarmSim console:
rosControlVehicle true
If you want to stop subscribing and gain control back in FarmSim, so you can drive around the farm yourself:
rosControlVehicle false
Force-center the camera if you use d3dshot_screen_grabber
to get a simulated RGB camera.
This command is used to fix the camera view while capturing the screen. In FarmSim, the camera view is dynamic when one moves the cursor. In order to simulate the rgb sensor, the camera view should be fixed at one angle as it is mounted on the vehicle.
To force-center the current camera, execute the following command in the FarmSim console:
forceCenteredCamera true
Stop forcing the camera:
forceCenteredCamera false
Once you have all the required components, please refer to fs_mod_ros to run ROS navigation stack on Linux.