Skip to content

A package to ease the interaction ROS nodes and the development of ROS software

License

Notifications You must be signed in to change notification settings

juraph-dev/ros.el

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

https://melpa.org/packages/ros-badge.svg

Juraph’s personal fork of ROS.el

Largest change is the addition of a “debug” flag, which allows the user to run a node through the emacs-gdb interface. works for both ros-2 and ros-1, supporting standalone executables and nodelets. There is a video of the addition on a blog post covering the process.

ros.el

ros.el is an emacs package which should ease the interaction with ROS nodes as well as help developing software for ROS systems. ROS is the R obot O perating S ystem and focuses on exchanging messages between nodes. Since the systems can become quite complex, why not use the best editor in the word to interact with it? The main advantage of this package over using the shell commands is using completing-read functions for almost anything which allows for fuzzy matching using packages like helm or ivy.

Requirements

Since ros.el supports ROS1 and ROS2, it uses colcon as its build system. Therefore Catkin workspaces are not supported.

Setup

  1. Install the package from Melpa
  2. Setup your ROS Workspaces. The chaining of the workspaces is configured explicitly by specifying the whole chain in the extends list.
    (setq ros-workspaces
          (list
           (ros-dump-workspace :tramp-prefix nil :workspace "~/main_ws" :extends '("/opt/ros/noetic/"))
           (ros-dump-workspace :tramp-prefix nil :workspace "~/overlay_ws" :extends '("/opt/ros/noetic/" "~/main_ws/install"))))
        

    The tramp-prefix can be used to setup remote workspaces over ssh or in docker containers

    (setq ros-workspaces (list (ros-dump-workspace :tramp-prefix (format "/docker:root@%s:" docker-container-id) :workspace "/ws" :extends '("/opt/ros/noetic/"))))
        
  3. Map the ROS Hydra (hydra-ros-main/body) to a prefix key.
  4. Select your current workspace by using ros-set-workspace or (PREFIX+w).

Usage

The hydra in hydra-ros-main/body incorporates most of the commands which are implemented. It heavily makes use of the transient menus to provide more options for the commands

Compiling

You can compile in your current workspace either individual packages or the whole workspace. Similarly you can decide to also run the tests. Every compile action you do is added to the ros-colcon-action-history and you can redo an action by using ros-compile-action, which prompts for a past action. Every action is accompanied with the workspace and additional flags. So you can compile package A in workspace W1 then switch to workspace W2 and compile package B in there and if you then choose to redo the first action you will do it properly in workspace W1.

Tests

Run tests for a package or the whole workspace (without triggering a build before).

Packages

For a specific package, go to the source, find file in package or search in the package

Messages / Services / Actions (only ROS2)

Show the definition of certain messages, services or actions, insert the name at point or include the definition in your current source file (works in cpp and python files)

Cache

Since setting up the list of packages, messages, services or actions takes quite a bit of time, these lists are cached after the first time they are build after emacs starts ( separately for every workspace ). If these changes or you add new packages or messages you might want to clean this cache

About

A package to ease the interaction ROS nodes and the development of ROS software

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Emacs Lisp 100.0%