Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build
install
log
Empty file modified LICENSE
100644 → 100755
Empty file.
60 changes: 39 additions & 21 deletions Makefile
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,52 @@ DOCKER_COMPOSE := $(shell if command -v docker-compose > /dev/null 2>&1; then ec

help:
@echo "Available commands:"
@echo " help: Show this help message"
@echo " up: Create and start containers"
@echo " down: Stop and remove containers"
@echo " restart: Restart containers"
@echo " start: Start containers"
@echo " stop: Stop containers"
@echo " term: Open a terminal in the container"
@echo " logs: View output from containers"

start:
@echo " help: Show this help message"
@echo " dc-up: Create and start containers"
@echo " dc-down: Stop and remove containers"
@echo " dc-reup: Recreate containers"
@echo " dc-start: Start containers"
@echo " dc-stop: Stop containers"
@echo " dc-restart: Restart containers"
@echo " dc-term: Open a terminal in the container"
@echo " dc-logs: View output from containers"
@echo " ros-build: Build ROS2 workspace"
@echo " ros-run: Run ROS2 launch file"
@echo " ros-clean: Clean ROS2 workspace"

dc-up:
$(DOCKER_COMPOSE) up -d

dc-down:
$(DOCKER_COMPOSE) down

dc-reup:
$(DOCKER_COMPOSE) down
$(DOCKER_COMPOSE) up -d

dc-start:
$(DOCKER_COMPOSE) start

stop:
dc-stop:
$(DOCKER_COMPOSE) stop

restart:
dc-restart:
$(DOCKER_COMPOSE) restart

up:
$(DOCKER_COMPOSE) up -d
dc-term:
$(DOCKER_COMPOSE) exec --user rosdev:rosdev ros_ws bash

down:
$(DOCKER_COMPOSE) down
dc-logs:
$(DOCKER_COMPOSE) logs -f

term:
$(DOCKER_COMPOSE) exec ros_ws zsh
ros-build:
colcon build --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON

logs:
$(DOCKER_COMPOSE) logs -f
ros-run:
ros2 launch inmoov_ros_sim main.launch.py

ros-clean:
rm -rf build install log

.PHONY: help start stop restart up down term
.PHONY: help dc-up dc-down dc-start dc-stop dc-restart dc-term dc-logs \
ros-build ros-run ros-clean
135 changes: 49 additions & 86 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -24,133 +24,96 @@ The simulator is shipped in a ROS 2 - ready to use - package

---

## 📥 Installation
## Requirements

### Setup workspace
- Ubuntu 22.04 or docker
- WSL (on windows)
- VNC Client
- Make (not mandatory but strongly recommended)

Create a workspace (here `inmoov_ws`) with an `src` folder and clone the repository in it
---

```bash
git clone [email protected]:Sentience-Robotics/inmoov_ros_sim.git inmoov_ws/src/inmoov_ros_sim
```
## 📥 Installation

Go to `inmoov_ws/src/inmoov_ros_sim/`
Execute the installation script

```bash
cd inmoov_ws/src/inmoov_ros_sim/
curl -fsSL https://raw.githubusercontent.com/Sentience-Robotics/inmoov_ros_sim/refs/heads/mbo/%232/inmoov-ros-sim-repo/scripts/install.sh | bash
```

### Install dependencies
### On docker

To install dependencies, you can either use the provided docker image (**A**) or install ROS 2 Humble locally (**B**):
<details>
<summary>A - Local Installation (Only if you're on Ubuntu 22.04)</summary>

For a local installation, you have to install the following dependencies:
- ROS 2 Humble
- rviz2 : visualisator
- Gazebo Fortress (launch script not available yet) : simulator
- Colcon, CMake : build system

First ensure that the Ubuntu Universe repository is enabled
When your installation is complete, execute the following commands

```bash
sudo apt install software-properties-common
sudo add-apt-repository universe
chmod -R 777 inmoov_ros_sim && \
cd inmoov_ros_sim && \
make dc-term
```

Now add the ROS 2 GPG key with apt.

```bash
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
```
---

Then add the repository to your sources list
## Usage

```bash
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null
```
### Makefile

Update your apt repository caches after setting up the repositories.
Available commands:
- help: Show this help message
- dc-up: Create and start containers
- dc-down: Stop and remove containers
- dc-reup: Recreate containers
- dc-start: Start containers
- dc-stop: Stop containers
- dc-restart: Restart containers
- dc-term: Open a terminal in the container
- dc-logs: View output from containers
- ros-build: Build ROS2 workspace
- ros-run: Run ROS2 launch file
- ros-clean: Clean ROS2 workspace

```bash
apt update -q
apt upgrade -q -y
```
### ⚙️ Compilation

Finally, install ros 2
Build the package

```bash
apt install -y ros-humble-desktop ros-humble-ros-gz ros-dev-tools ros-humble-joint-state-publisher ros-humble-joint-state-publisher-gui
```
make ros-build

Source ros
> On bash
```bash
source /opt/ros/humble/setup.bash
```
> On zsh
```zsh
source /opt/ros/humble/setup.zsh
```
</details>

<details>
<summary>B -Docker Installation</summary>

Authorize the docker to access the X server
Source your workspace

```bash
xhost +
source ./install/local_setup.bash
```

Start the docker container
### 🖥️ Display (for docker)

```bash
make up
```
Install a vnc client (you can use remmina, vncviewer, etc)

Connect to the container
Vnc server use :1 by default.

Export your display from the container

```bash
make term
export DISPLAY=:1
```

</details>

You will also need to have a running X server to display the simulation
Connect the vnc client to the container

On windows, you can use [VcXsrv](https://sourceforge.net/projects/vcxsrv/)
Host: `127.0.0.1:1`

On linux, you can either use X11 or XWayland
Password: `abc123`

---

## ⚙️ Compilation

Build the package
### 🚀 Launch the package

```bash
colcon build

```
Source your workspace
> On bash
```bash
source ./install/local_setup.bash
```
> On zsh
```zsh
source ./install/local_setup.zsh
make ros-run
```

---

## 🚀 Launch the package
## 📖 Documentation

```bash
ros2 launch inmoov_ros_sim main.launch.py
```
For more details on creation processes, troubleshooting, and other guidance, visit the [Sentience Robotics documentation](https://docs.sentience-robotics.fr).

---

Expand All @@ -174,7 +137,7 @@ To find out more on how you can contribute to the project, please check our [CON

## 📜 License

This project is licensed under the GNU GPL V3 License. See the LICENSE file for details.
This project is licensed under the **GNU GPL V3 License**. See the [LICENSE](LICENSE) file for details.

---

Expand Down
11 changes: 4 additions & 7 deletions docker-compose.yml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
services:
ros_ws:
image: ghcr.io/sentience-robotics/ros_ws:humble
restart: no
command: tail -f /dev/null
environment:
- DISPLAY=$DISPLAY
image: ghcr.io/sentience-robotics/ros2_base:humble
restart: unless-stopped
volumes:
- .:/home/rosdev/ros2_ws/src/inmoov_ros_sim
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- .:/home/rosdev/ros2_ws/:rw
network_mode: host
17 changes: 17 additions & 0 deletions scripts/docker_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

if $(command -v docker) compose &> /dev/null; then
DOCKER_COMPOSE="$(command -v docker) compose"
elif command -v docker-compose &> /dev/null; then
DOCKER_COMPOSE="$(command -v docker-compose)"
else
echo -e "\033[31m\033[1mdocker-compose is not installed\033[0m"
exit 1
fi

$DOCKER_COMPOSE -f docker-compose.yml up -d

echo -e "\033[32m\033[1mInstallation complete\033[0m, you can now access the container with the following command:"
echo "chmod -R 777 inmoov_ros_sim && \\"
echo " cd inmoov_ros_sim && \\"
echo " make dc-term"
38 changes: 38 additions & 0 deletions scripts/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

mkdir inmoov_ros_sim
cd inmoov_ros_sim

base_url="$(pwd)/scripts"

GIT=$(type -p git)
if [[ ! -x "$GIT" ]]; then
echo -e "\033[31m\033[1mgit is not installed\033[0m"
exit 1
fi

if [[ "$(ls -A)" ]]; then
echo -e "\033[31m\033[1mdirectory must be empty\033[0m"
exit 1
fi

read -p "Enter the branch name [master]: " branch < /dev/tty
branch=${branch:-master}

echo -e "\033[32m\033[1mCloning repository...\033[0m"
$GIT clone --branch $branch https://github.com/Sentience-Robotics/inmoov_ros_sim.git . 2> /dev/null

echo "Do you prefer to use a local or a docker installation?"
read -p "Select installation mode (local/docker) [docker] :" choice < /dev/tty
choice=$(echo $choice | tr '[:upper:]' '[:lower:]')

if [[ -z "$choice" || "$choice" == "d" || "$choice" == "docker" ]]; then
cat $base_url/docker_install.sh | bash
exit 0
elif [[ "$choice" == "l" || "$choice" == "local" ]]; then
cat $base_url/local_install.sh | bash
exit 0
else
echo -e "\033[31m\033[1mInvalid choice\033[0m"
exit 1
fi
20 changes: 20 additions & 0 deletions scripts/local_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

sudo apt install -q -y software-properties-common

sudo add-apt-repository universe && \
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null && \
apt update -q && \
apt upgrade -q -y

sudo apt install -y ros-humble-desktop ros-humble-ros-gz ros-dev-tools

sudo apt install -y ros-humble-joint-state-publisher ros-humble-joint-state-publisher-gui

echo 'source /opt/ros/'$ROS_DISTRO'/setup.bash' >> /home/$USERNAME/.bashrc && \
echo 'source /home/'$USERNAME'/ros2_ws/install/local_setup.bash' >> /home/$USERNAME/.bashrc

echo 'source /opt/ros/'$ROS_DISTRO'/setup.zsh' >> /home/$USERNAME/.zshrc && \
echo 'source /home/'$USERNAME'/ros2_ws/install/local_setup.zsh' >> /home/$USERNAME/.zshrc

File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions launch/main.launch.py → src/inmoov_ros_sim/launch/main.launch.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
def generate_launch_description():

# Set the path to this package.
pkg_share = FindPackageShare(package='sentience_gz').find('sentience_gz')
pkg_share = FindPackageShare(package='inmoov_ros_sim').find('inmoov_ros_sim')

# Set the path to the RViz configuration settings
default_rviz_config_path = os.path.join(pkg_share, 'rviz/rviz_basic_settings.rviz')

# Set the path to the URDF file
default_urdf_model_path = os.path.join(pkg_share, 'urdf/sentience_gz.urdf')
default_urdf_model_path = os.path.join(pkg_share, 'urdf/inmoov.urdf')

########### YOU DO NOT NEED TO CHANGE ANYTHING BELOW THIS LINE ##############
# Launch configuration variables specific to simulation
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Loading