Skip to content

Commit

Permalink
Merge pull request #3 from facebookresearch/austinw/minimal_fairo_impl
Browse files Browse the repository at this point in the history
Minimal working version of Stretch infra features in fairo
  • Loading branch information
exhaustin authored Nov 9, 2022
2 parents fee4a01 + 2b5ac15 commit a1417cb
Show file tree
Hide file tree
Showing 46 changed files with 28,915 additions and 28,267 deletions.
32 changes: 31 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,37 @@ jobs:
pip install black==22.3.0
black --check .
integration-sim:
working_directory: ~/home-robot
resource_class: large
docker:
- image: continuumio/miniconda3
steps:
- checkout
- restore_cache:
key: deps9-{{ .Branch }}-{{ checksum "tests/test_env.yml" }}
- run:
name: Setup env
command: |
apt-get update
apt-get install -y build-essential
[ -d ~/testenv ] || conda env create -f tests/test_env.yml -p ~/testenv
- save_cache:
key: deps9-{{ .Branch }}-{{ checksum "tests/test_env.yml" }}
paths:
- "~/testenv"
- "/usr/lib"
- run:
name: Run tests
command: |
conda init bash
source ~/.bashrc
conda activate ~/testenv
pip install -e .
pytest
workflows:
main:
jobs:
- formatting
- formatting
- integration-sim
60 changes: 58 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,70 @@
# Home Robot

[![CircleCI](https://dl.circleci.com/status-badge/img/gh/fairinternal/home-robot/tree/main.svg?style=shield&circle-token=625410c58d3e31cedd2f6af22b4f27343d866a77)](https://dl.circleci.com/status-badge/redirect/gh/fairinternal/home-robot/tree/main)
[![CircleCI](https://dl.circleci.com/status-badge/img/gh/facebookresearch/home-robot/tree/main.svg?style=shield&circle-token=282f21120e0b390d466913ef0c0a92f0048d52a3)](https://dl.circleci.com/status-badge/redirect/gh/facebookresearch/home-robot/tree/main)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

Mostly Hello Stretch infrastructure

## Installation

TODO
1. Prepare a conda environment (ex: `conda create -n home_robot python=3.8`)
1. Install Mamba (needed for MRP): `conda install -c conda-forge mamba`
1. Install repo `pip install -e .`

### Additional instructions for setting up on hardware

1. Setup the Stretch robot following official instructions [here](https://github.com/hello-robot/stretch_install)
1. Install stretch_ros following official instructions [here](https://github.com/hello-robot/stretch_ros/blob/dev/noetic/install_noetic.md)
1. Install Hector SLAM: `sudo apt install ros-noetic-hector-*`

## Usage

### Launching the hardware stack:
```sh
cd src/home_robot
mrp up hw_stack
```

This launches:
- Stretch ROS driver
- Hector SLAM
- State estimation node
- Continuous controller node

### Launching a minimal kinematic simulation (no camera yet)
```sh
cd src/home_robot
mrp up sim_stack
```

This launches:
- Fake stretch node (A kinematic simulation that publishes 100% accurate odometry and slam information and accepts velocity control inputs)
- State estimation node
- Continuous controller node

### Launching a simple local command line interface (CLI) on the robot:

The CLI currently exposes a simple base control interface via the terminal.
The interface `home_robot.client.LocalHelloRobot` can also be imported and used within user scripts.

```sh
cd src/home_robot/client
mrp up local_cli --attach
```

Available commands:
```py
robot.get_base_state() # returns base location in the form of [x, y, rz]
robot.toggle_controller() # turns goto controller on/off (robot always tries to move to /goto_controller/goal if on)
robot.toggle_yaw_tracking() # turns yaw tracking on/off (robot only tries to reach the xy position of goal if off)
robot.set_goal(xyt: list) # sets the goal for the goto controller
robot.set_velocity(v: float, w: float) # directly sets the linear and angular velocity of robot base (command gets overwritten immediately if goto controller is on)
```

### Stopping all processes
```sh
mrp down
```

## Code Contribution

Expand Down
15 changes: 15 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from setuptools import setup

install_requires = [
"mrp",
"pytest",
]

setup(
name="home_robot",
version=1.0,
packages=["home_robot"],
package_dir={"": "src"},
install_requires=install_requires,
zip_safe=False,
)
Loading

0 comments on commit a1417cb

Please sign in to comment.