Setup environment
Under Construction
Ubuntu
The system is developed under Ubuntu 22 linux. You can chose between two setups:
Desktop/Laptop setup
Developer:
Use this if you want to configure en programm ESP32 devices
Acts also as server for the microROS agent and the grapical use interface
You can als use a virtual environment(for example BusyBox or VM-ware)
Raspberry PI setup
Server:
Acts as an server for the microROS agant and the graphical user interface
It is not possible to programm ESP32 devices
Hybride system with Desktop/Laptop server for programming ESP32 devices
Note: Be sure to update Ubuntu after installing
cd ~
sudo apt update
sudo apt upgrade
ROS
The system uses ROS2 Humble as a middelware for controlling locomotives en Turnouts. You can install using the following options:
Using script: run install_ros2_humble_desktop.sh script in scripts directory of this repository.
cd ~/railtrack_ws/src/railtrack/scripts
./install_ros2_humble_desktop.sh
Manually: Install ROS-Humbe
Colcon
The system uses the Colcon build system for compiling the ROS2 Humble workspace. You can install using the following options:
Using script:run install_colcon.sh script in scripts directory of this repository.
cd ~/railtrack_ws/src/railtrack/scripts
./install_colcon.sh
Manually: Install Colcon
Add ROS2 environment
echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
Note: Execute this command only once. If multiple lines exists in “~/.bashrc” remove all other lines.
Create ROS2 railtrack workspace
Use the folowing commands to create the railtrack workspace
cd ~
mkdir railtrack_ws/src -p
cd railtrack_ws/src
git clone https://github.com/GerardHarkema/railtrack.git
Build ROS2 railtrack workspace
cd ~/railtrack_ws
colcon build --symlink-install
Add the workspace to the ROS environment:
echo "source ~/railtrack_ws/src/install/setup.bash" >> ~/.bashrc
Note: Execute this command only once. If multiple lines exists in “~/.bashrc” remove all other lines
Visual Code & PlatformIO
Visual Code acts as an system for modifying, editing files in the railtrack system. The plugin from PlatformIO makes it possible to program ESP32 devices for controlling turnouts and the Marklin railtrack to CAN bridge.
Following instructions for Installing Visual Studio Code on Linux
Following instruction for Add platfomIO plugin to VisualCode
Python Libraries
Use follwing script to install missing Python libraries
cd ~/railtrack_ws/src/railtrack/scripts
./install_required_packages.sh
Next thing to do is creating the microROS-agent. See: Install microROS agent