https://github.com/artivis/ansible-role-ros

An Ansible role to set up a ROS environment

https://github.com/artivis/ansible-role-ros

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (7.8%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

An Ansible role to set up a ROS environment

Basic Info
  • Host: GitHub
  • Owner: artivis
  • Default Branch: main
  • Size: 5.86 KB
Statistics
  • Stars: 5
  • Watchers: 2
  • Forks: 1
  • Open Issues: 0
  • Releases: 0
Created over 3 years ago · Last pushed almost 2 years ago
Metadata Files
Readme

README.md

ansible-role-ros

An Ansible role to set up ROS or ROS 2.

Intro

This role automatically sets up a ROS (2) environment. It automatically detects the Ubuntu distribution and installs the corresponding ROS LTS distribution.

Variables

  • ros_version (optional) whether to install ROS or ROS 2. Defaults to '2'.
  • ros_variant (optional) Install a ROS variant as defined in REP 131. Defaults to 'ros-base'.

Use

From an Ansible playbook

Install the role from GitHub,

bash ansible-galaxy install https://github.com/artivis/ansible-role-ros.git

Create an example playbook my-playbook.yml,

```yaml

  • hosts: localhost connection: local roles: [ansible-role-ros] ```

and execute it,

bash ansible-playbook -i localhost my-playbook.yml -e 'ros_version=1'

Through cloud-init

Create a cloud-init configuration file my-cloud-init.yaml,

```yaml

cloud-config

Import SSH key from GitHub

sshimportid: - gh:my-github-user

Earlier version of the ansible module

doesn't install pip automatically.

Let's avoid any surprise

packages: - python3-pip

We need an Ansible playbook to run.

write_files: - content: | --- - hosts: localhost connection: local roles: [ansible-role-ros] path: /home/ubuntu/ros-playbook.yml owner: ubuntu:ubuntu permissions: '0444' defer: true

Install Ansible from pip so that we can run it as a given user.

It also retrieve the Ansible ROS role straight from GitHub.

Finally execute the playbook created above.

ansible: installmethod: pip packagename: ansible run_user: ubuntu

galaxy: actions: - ["ansible-galaxy", "install", "https://github.com/artivis/ansible-role-ros.git"]

setupcontroller: runansible: - playbookdir: /home/ubuntu playbookname: "ros-playbook.yml" extravars: "'rosversion=1 ros_variant=robot'" ```

Set up ROS in a Linux container

Launch a Linux container using LXD with the cloud-init configuration,

bash lxc launch ubuntu:20.04 lxc-ros-noetic --config=user.user-data="$(cat ./my-cloud-init.yaml)"

While we could connect to the freshly spawn container, we better wait for cloud-init to finish,

bash lxc exec lxc-ros-noetic -- cloud-init status --wait

Set up ROS in an Ubuntu VM

Launch an Ubuntu virtual machine with multipass with the cloud-init configuration,

bash multipass launch focal -n vm-ros-noetic --cloud-init my-cloud-init.yaml

Owner

  • Name: Jeremie Deray
  • Login: artivis
  • Kind: user
  • Location: France
  • Company: @CanonicalLtd

Roboticist / Software Developer, ROS(2) / C++ enthusiast.

GitHub Events

Total
  • Watch event: 1
Last Year
  • Watch event: 1

Issues and Pull Requests

Last synced: about 1 year ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Dependencies

.github/workflows/ci.yaml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite