Skip to content

Commit

Permalink
User/raghavauppuluri13/quick docs (#53)
Browse files Browse the repository at this point in the history
* added docs for teensy compilation + upload

* added more docs

* typo fix
  • Loading branch information
raghavauppuluri13 authored Jan 13, 2024
1 parent fafb712 commit c0a9831
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 47 deletions.
13 changes: 6 additions & 7 deletions lunabot_bringup/launch/robot.launch
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

<include if="$(arg cameras)" file="$(find lunabot_perception)/launch/cameras.launch"/>
<include if="$(arg record)" file="$(find lunabot_bringup)/launch/record.launch">

<arg name="exp_name" value="$(arg exp_name)"/>
</include>

Expand All @@ -38,12 +37,12 @@
<!-- <rosparam file="$(find lunabot_config)/config/rrtstar.yml" command="load"/> -->
</node>
</group>
<!-- mapping -->
<group ns="maps">
<node name="costmap_node" pkg="lunabot_perception" type="costmap_node" output="screen">
<rosparam file="$(find lunabot_config)/config/global_costmap.yml" command="load" ns="global_costmap" />
</node>
</group>

<group ns="maps">
<node name="costmap_node" pkg="lunabot_perception" type="costmap_node" output="screen">
<rosparam file="$(find lunabot_config)/config/global_costmap.yml" command="load" ns="global_costmap" />
</node>
</group>

</group>
</launch>
13 changes: 5 additions & 8 deletions lunabot_embedded/firmware/setup_flash_tools.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
#!/bin/sh

## Installs compilation tools
# get arduino-cli executable (replace with Linux_x86 if necessary)
wget https://downloads.arduino.cc/arduino-cli/arduino-cli_latest_Linux_ARM64.tar.gz
tar -xvf arduino-cli_latest_Linux_ARM64.tar.gz
./arduino-cli config init
arduino-cli config init
python3 update_board_manager.py
./arduino-cli core install teensy:avr
./arduino-cli lib install HX711-master
./arduino-cli lib install ADS1115-Lite
arduino-cli core install teensy:avr
arduino-cli lib install HX711-master
arduino-cli lib install ADS1115-Lite

## Installs teensy flasher
sudo apt-get install libusb-dev
Expand All @@ -17,4 +14,4 @@ cd teensy_loader_cli
make
sudo make install
cd ..

rm -rf teensy_loader_cli
35 changes: 29 additions & 6 deletions lunabot_embedded/readme.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,45 @@
# lunabot_embedded



## Jetson Code
## Jetson Teensy C++ Driver

- code in `src` folder
- see `RobotEffort.msg`
- see `RobotState.msg`

## Teensy Code
## Teensy Firmware

code in `firmware/teensy_main/`

### Prerequisites
- [Install arduino-cli compilation toolchain](https://arduino.github.io/arduino-cli/0.35/installation/#use-the-install-script)

- code in `firmware/teensy_main/`
### Quick start

1. Setup development environment

```
roscd lunabot_embedded/firmware
./setup_flash_tools.sh
```

2. Add aliases to simplify compilation (in `.bashrc` or `.zshrc`):
```
alias teensy_compile="arduino-cli compile --build-path build --libraries lib --fqbn teensy:avr:teensy41:usb=rawhid teensy_main"
alias teensy_upload="teensy_loader_cli --mcu=TEENSY41 -wv build/teensy_main.ino.hex"
```

3. Compile (no hardware needed) + Upload

```
roscd lunabot_embedded/firmware/teensy_main
teensy_compile
teensy_upload
```

## Regenerate Proto files
## Regenerate Proto files

```
pip3 install nanopb
roscd lunabot_embedded/firmware/teensy_main/lib/lunabot_drivers
python3 -m nanopb.generator.nanopb_generator -L quote RobotMsgs.proto
```
9 changes: 9 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

This is the official git repo of the Purdue Lunabotics software team.

## Supported Platforms
- Ubuntu 20.04

## Quick Start

1. [Install ROS](https://wiki.purduearc.com/wiki/tutorials/setup-ros)
Expand Down Expand Up @@ -29,3 +32,9 @@ catkin build
source ~/catkin_ws/devel/setup.bash # or .zsh if you use a zsh terminal
```
> Note: Build + source every time you add new packages. Source every time you open a fresh terminal, or add the line to your ~/.bashrc (or .zshrc) so it sources automatically

## Important docs to read
- [contributing guidelines](https://github.com/PurdueLunabotics/purdue_lunabotics/blob/master/contributing.md)
- [running_the_robot](https://github.com/PurdueLunabotics/purdue_lunabotics/blob/master/running_the_robot.md)
- [firmware setup](https://github.com/PurdueLunabotics/purdue_lunabotics/blob/master/lunabot_embedded/readme.md)
43 changes: 17 additions & 26 deletions running_the_robot.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
### Run commands on the robot
## Run commands on the robot

#### Setup Networking
### Setup Networking

1. Connect router to power

> Optionally to get wifi, connect "internet" port on router to an external ethernet port with wifi
2. Connect computer to ethernet port on the router
3. Turn on the jetson and wait atleast 30 sec
3. Turn on the jetson and wait 10-15 sec

#### Manual Control
### Start robot (default is manual)

1. Open a terminal, set the ROS IP info on the laptop and run the magic run command:
```
Expand All @@ -23,41 +23,32 @@ ssh <jetson-ip>
roslaunch lunabot_bringup robot.launch
```

#### Autonomy
#### Other cmdline options

1. Open a terminal, set the ROS IP info on the laptop and run the magic run command:
```
source ~/set_ip.sh
roslaunch lunabot_bringup computer.launch autonomy:=true
```

2. Open another terminal, ssh into the robot and run the robot
```
ssh <jetson-ip>
roslaunch lunabot_bringup robot.launch autonomy:=true
```
1. On computer

#### Extra Options
- `autonomy:=true`: disables publishing of manual control

2. On jetson
- `exp_name:="mpc_test"`: experiment name
- `autonomy:=true`: enables slam, differential drive controller, mpc, global planner,
- `record:=true`: enables recording to `lunabot_bringup/bags`, ensure the folder exists
- `cameras:=true`: enables cameras
- `slam:=true`: enables slam

## Joystick commands


### Manual Control Commands

##### General commands
### General commands
- cross key left/right: deposition (up/down)
- cross key up/down: lead screw (up/down
- B button: stop everything and latch excavation to zero
- X button: switch mode
- Y button: latch/unlatch excavation (only done in excavation mode

##### Drive mode
### Drive mode
- left and right joysticks (up/down): tank drive controls for drivetrain (left stick controls left wheel, right stick controls right wheel)

##### Excavation mode
### Excavation mode
- left joystick (up/down): Excavation (forward/backward)
- latch (Y button): will latch current value of excavation and ignore joystick values, press Y again to unlatch
- right joystick (up/down): Actuation (up/down)

## Contributing guidelines
See https://github.com/PurdueLunabotics/purdue_lunabotics/blob/master/contributing.md

0 comments on commit c0a9831

Please sign in to comment.