diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b405a01 --- /dev/null +++ b/.gitignore @@ -0,0 +1,18 @@ +# Exclude build artifacts and logs +/cache/ +*.log + +# Exclude other potential build artifacts +*.o +*.a +*.so + +# Exclude IDE and system-specific files +*.swp +*.swo +.DS_Store +*.pyc +*.pyo + +# Exclude local configuration files +*.env diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..9198c85 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "src/turtlebot3_simulations"] + path = src/turtlebot3_simulations + url = https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git + branch = humble-devel diff --git a/README.md b/README.md index b8b6790..1b74aa1 100644 --- a/README.md +++ b/README.md @@ -1 +1,99 @@ -# Collaborative-Autonomous-Multi-Agent-SLAM \ No newline at end of file +# Collaborative-Autonomous-Multi-Agent-SLAM +## Table of Contents +- [Setup Development Environment](#setup-development-environment) + - [ROS](#ros) + - [Gazebo](#gazebo) + - [Python](#python) +- [Troubleshooting Help](#troubleshooting-help) +- [Interacting with the Platform](#interacting-with-the-platform) +- [Resources](#resources) + +## Setup Development Environment + +### ROS +To set up the ROS environment, follow these steps: + +1. **Install ROS** + - Open the "x64 Native Tools Command Prompt for VS 2019" as Administrator. + - Install Chocolatey package manager: + ```sh + @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" + ``` + - Install Git: + ```sh + choco upgrade git -y + ``` + - Install ROS: + ```sh + mkdir c:\opt\chocolatey + set ChocolateyInstall=c:\opt\chocolatey + choco source add -n=ros-win -s="https://aka.ms/ros/public" --priority=1 + choco upgrade ros-noetic-desktop_full -y --execution-timeout=0 + ``` + +2. **Source the ROS Environment** + - Open the Visual Studio Command Prompt as Administrator. + - Source the setup script: + ```sh + c:\opt\ros\noetic\x64\setup.bat + ``` + +3. **Verify the ROS Installation** + - Check the ROS version: + ```sh + rosversion -d + ``` + +For more detailed instructions, refer to the [Installing and Configuring Your ROS Environment](https://wiki.ros.org/ROS/Tutorials/InstallingandConfiguringROSEnvironment) tutorial. + +### Gazebo +To set up Gazebo, follow these steps: + +1. **Install Gazebo** + - Use the ROS package manager to install Gazebo: + ```sh + sudo apt-get install ros-noetic-gazebo-ros-pkgs ros-noetic-gazebo-ros-control + ``` + +2. **Verify the Gazebo Installation** + - Run Gazebo to ensure it's installed correctly: + ```sh + gazebo + ``` + +### Python +To set up Python for ROS: + +1. **Install Python** + - Download and install Python from the [official website](https://www.python.org/downloads/). + +2. **Install ROS Python Dependencies** + - Install the necessary Python packages for ROS: + ```sh + pip install -U rosdep rosinstall_generator wstool rosinstall six vcstools + ``` + +## Troubleshooting Help +If you encounter issues during setup, here are some common troubleshooting steps: + +- Ensure all paths are correctly set in your environment variables. +- Verify that you are running the commands in the appropriate shell (e.g., Visual Studio Command Prompt for VS 2019). +- Check for any typos or syntax errors in the commands. +- Refer to the [ROS Troubleshooting Guide](https://wiki.ros.org/ROS/Installation/Windows#Troubleshooting). + +## Interacting with the Platform +To start working with the platform, follow these steps: + +1. **Create a Catkin Workspace** + ```sh + mkdir -p ~/catkin_ws/src + cd ~/catkin_ws/ + catkin_make + source devel/setup.bash + cd ~/catkin_ws/src + catkin_create_pkg my_package std_msgs rospy roscpp + cd ~/catkin_ws + catkin_make + + + diff --git a/src/rviz-mac/Dockerfile b/src/rviz-mac/Dockerfile new file mode 100644 index 0000000..41d3b2d --- /dev/null +++ b/src/rviz-mac/Dockerfile @@ -0,0 +1,53 @@ +# Use the official ROS Humble base image +FROM ros:humble +# Update apt sources to use Tsinghua mirrors +RUN sed -i 's/ports\.ubuntu\.com/mirrors\.tuna\.tsinghua\.edu\.cn/g' /etc/apt/sources.list && \ + sed -i 's/packages\.ros\.org/mirrors\.tuna\.tsinghua\.edu\.cn/g' /etc/apt/sources.list.d/ros2-latest.list +# Install necessary packages +RUN apt-get update && apt-get install -y \ + iputils-ping \ + net-tools \ + wget \ + sudo \ + python3-pip \ + mesa-utils \ + mesa-utils-extra \ + ros-humble-desktop \ + ros-humble-cartographer \ + ros-humble-cartographer-ros \ + ros-humble-navigation2 \ + ros-humble-nav2-bringup \ + ros-humble-rviz2 \ + bash \ + fluxbox \ + git \ + novnc \ + supervisor \ + x11vnc \ + xterm \ + xvfb && \ + rm -rf /var/lib/apt/lists/* +# Create a workspace +RUN mkdir -p /root/catkin_ws +WORKDIR /root/catkin_ws +# Source ROS environment +RUN echo "source /opt/ros/humble/setup.bash" >> /root/.bashrc +# Set environment variables +ENV HOME=/root \ + DEBIAN_FRONTEND=noninteractive \ + LANG=en_US.UTF-8 \ + LANGUAGE=en_US.UTF-8 \ + LC_ALL=C.UTF-8 \ + DISPLAY=:0.0 \ + DISPLAY_WIDTH=1024 \ + DISPLAY_HEIGHT=768 \ + RUN_XTERM=yes \ + RUN_FLUXBOX=yes \ + ROS_MASTER_URI=http://172.16.0.240:11311 \ + ROS_HOSTNAME=ros +# Copy application files +COPY . /app +# Set the default command +CMD ["/app/entrypoint.sh"] +# Expose port +EXPOSE 8080 \ No newline at end of file diff --git a/src/rviz-mac/conf.d/fluxbox.conf b/src/rviz-mac/conf.d/fluxbox.conf new file mode 100644 index 0000000..96793ad --- /dev/null +++ b/src/rviz-mac/conf.d/fluxbox.conf @@ -0,0 +1,3 @@ +[program:fluxbox] +command=fluxbox +autorestart=true diff --git a/src/rviz-mac/conf.d/websockify.conf b/src/rviz-mac/conf.d/websockify.conf new file mode 100644 index 0000000..d15418c --- /dev/null +++ b/src/rviz-mac/conf.d/websockify.conf @@ -0,0 +1,3 @@ +[program:websockify] +command=websockify --web /usr/share/novnc 8080 localhost:5900 +autorestart=true diff --git a/src/rviz-mac/conf.d/x11vnc.conf b/src/rviz-mac/conf.d/x11vnc.conf new file mode 100644 index 0000000..2fff49a --- /dev/null +++ b/src/rviz-mac/conf.d/x11vnc.conf @@ -0,0 +1,3 @@ +[program:x11vnc] +command=x11vnc -forever -shared +autorestart=true diff --git a/src/rviz-mac/conf.d/xterm.conf b/src/rviz-mac/conf.d/xterm.conf new file mode 100644 index 0000000..da1af44 --- /dev/null +++ b/src/rviz-mac/conf.d/xterm.conf @@ -0,0 +1,3 @@ +[program:xterm] +command=xterm +autorestart=true diff --git a/src/rviz-mac/conf.d/xvfb.conf b/src/rviz-mac/conf.d/xvfb.conf new file mode 100644 index 0000000..29949d8 --- /dev/null +++ b/src/rviz-mac/conf.d/xvfb.conf @@ -0,0 +1,3 @@ +[program:xvfb] +command=Xvfb :0 -screen 0 "%(ENV_DISPLAY_WIDTH)s"x"%(ENV_DISPLAY_HEIGHT)s"x24 -listen tcp -ac +autorestart=true diff --git a/src/rviz-mac/entrypoint.sh b/src/rviz-mac/entrypoint.sh new file mode 100644 index 0000000..283ca62 --- /dev/null +++ b/src/rviz-mac/entrypoint.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -ex + +RUN_FLUXBOX=${RUN_FLUXBOX:-yes} +RUN_XTERM=${RUN_XTERM:-yes} + +case $RUN_FLUXBOX in + false|no|n|0) + rm -f /app/conf.d/fluxbox.conf + ;; +esac + +case $RUN_XTERM in + false|no|n|0) + rm -f /app/conf.d/xterm.conf + ;; +esac + +exec supervisord -c /app/supervisord.conf diff --git a/src/rviz-mac/supervisord.conf b/src/rviz-mac/supervisord.conf new file mode 100644 index 0000000..3dd2ac7 --- /dev/null +++ b/src/rviz-mac/supervisord.conf @@ -0,0 +1,5 @@ +[supervisord] +nodaemon=true + +[include] +files = /app/conf.d/*.conf