This repository contains ROS nodes needed to run in Windows.
- Windows 10
- Python
3.8.5(other versions have not been tested)
A ROS installation on Windows is not needed as rospypi/simple is used.
Clone the repository or download the .zip at any location
git clone https://github.com/tud-cor/fs_mod_ros_windows.gitREM create a virtual environment
python -m venv venv_modROS
REM activate the venv
venv_modROS\Scripts\activate.bat
REM change the active directory to the location of fs_mod_ros_windows
cd path\to\fs_mod_ros_windows
REM install Python dependencies
pip install -r nodes\requirements.txtThere are four types of data which can be exchanged from farmsim and be published as ROS messages:
rosgraph_msgs/Clock: in-game simulated clock which is not linked to real-time clock. However, the timescale can be configured within Farming Simulator to be real time or 5x, 15x, 30x, 60x or 120x faster than real-time. TheClockmessage stops being published when the game is paused/exitednav_msgs/Odometry: ground-truthPoseandTwistof vehicles based on the in-game position and orientationsensor_msgs/LaserScan: a simulated multi layer lidarsensor_msgs/Imu: a simulated IMU
The FarmSim mod subscribes to only a single topic (for now):
geometry_msgs/Twist: controls the currently active vehicle in FarmSim (this is also used bymove_basewhen using the navigation stack)
The following are step-by-step instructions allow you to run ROS nodes in Windows 10. There are two parts of the instructions. One is for publishing data, the other is for subscribing data.
Before starting the node, make sure a roscore is running (either locally or remotely)
REM open one cmd window, activate the base virtual environment
venv_modROS\Scripts\activate.bat
REM go to the directory where all_in_one_publisher.py is located
cd path\to\fs_mod_ros_windows\nodesIf you would like to run the navigation stack, start the script with following remapping argument:
python all_in_one_publisher.py tf:=fstfIf you are not going to run the navigation stack, simply run:
python all_in_one_publisher.pyOpen another cmd window, activate the base virtual environment you created and run the script:
venv_modROS\Scripts\activate.bat
cd path\to\fs_mod_ros_windows\nodes
python cm_vel_subscriber.py