Skip to content

Latest commit

 

History

History
90 lines (79 loc) · 4.42 KB

roshask-notes.org

File metadata and controls

90 lines (79 loc) · 4.42 KB

Change from snap to warp

It looks like building directly on warp might be a simpler choice for all HTTP needs. We do most of our work through haxr as it stands, and do not want or need a heavier server.

Code Organization

Ros

Graph

The ROS computation graph is the overarching connectivity between ROS nodes and a ROS master. This is where topic publication is registered with the master, subscriptions are initiated between nodes, node parameters may be set, and services are registered.

Node

Functionality related to ROS nodes: registration with a master, topic publication registration, inter-node connectivity.

Topic

Functionality relating to ROS topics. Combinators for working with topic streams, stamped and otherwise.

Rate

A rate limiter often used by publishers.

Logging

Support for ROS-style log messages using Template Haskell to get source location.

Util

Additional supporting definitions for client code rather than internal implementation.

Internal

Definitions used in the implementation that are not likely to be relevant to end users.

executable

The roshask executable whose primary responsibilities are to initialize new packages and generation Haskell packages corresponding to message definitions found in ROS package dependencies.

Vagrant

[[http://www.vagrantup.com] [Vagrant]] is used to provide a common development environment that can be re-created on various platforms. On Windows and Mac, VirtualBox can be used to provide a virtual machine (VM) to host a ROS-friendly Ubuntu environment. When the current working directory contains the Vagrantfile defining a VM, a few simple commands to remember are:

commanddescription
vagrant upStart a new VM
vagrant sshssh into a running VM
vagrant suspendSuspend a running VM
vagrant resumeResume a suspended VM
vagrant reload –provisionRestart a VM after changing its configuration
vagrant destroyRemove all resources used by a VM

VM Configuration

As well as the Vagrantfile, we use a bash script, vagrant/bootstrap.sh to install things in the VM. This is somewhat flaky at the moment as it, for example, runs through the ROS installation procedure which appends a line at the end of ~/.bashrc even if that line is already there.

By default, the directory containing the Vagrantfile is shared with the VM. This will be the root roshask directory in most cases. This directory on the host (your computer) is mapped to /vagrant on the guest (the VM).

GitHub

A convention used here is to configure SSH on the guest to work with [[http://www.github.com] [GitHub]] by using a key file the guest finds at /vagrant/vagrant/ssh/github, which maps to the host at roshask/vagrant/ssh/github. Generate a new SSH key on your host machine at the mapped location, set that key up with GitHub, and now the VM can push to your repositories on GitHub.

Emacs

Try out vagrant-tramp mode. It is on MELPA, and I patched it to work with default VirtualBox-based Vagrant configurations.

Workflow

I work with the source on a host machine, but build and test in the vagrant environment. The roshask directory on my host machine is mapped to /vagrant on the guest, while the user home directory on the guest is /home/vagrant. On the guest machine, I create the directory /home/vagrant/roshask, then symlink all source directories and files from /vagrant to /home/vagrant/roshask. I then initialize a sandbox in /home/vagrant/roshask, so that .cabal-sandbox is on the guest machine.

It can be convenient to share sandboxes between the example programs and roshask itself if you are working on roshask. In an example program directory, run cabal sandbox init --sandbox=/home/vagrant/roshask/.cabal-sandbox. The absolute path is important as you don’t want to accidentally follow a symlink back to the directory shared with the host.