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
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
.
Since ros.el supports ROS1 and ROS2, it uses colcon as its build system. Therefore Catkin workspaces are not supported.
- Install the package from Melpa
- 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/"))))
- Map the ROS Hydra (
hydra-ros-main/body
) to a prefix key. - Select your current workspace by using
ros-set-workspace
or (PREFIX+w
).
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
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
.
Run tests for a package or the whole workspace (without triggering a build before).
For a specific package, go to the source, find file in package or search in the package
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)
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