Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ All notable changes to HotDog. Format: [Keep a Changelog](https://keepachangelog
- `hotdog_reports`: a page per patrol with every point, finding, the change since the last
round of the same finding and the evidence images; day and front pages; retention by age
and free space; the reports served read-only on port 8088 (`reports`, `REPORTS`).
- `hotdog_alerts`: warning and critical findings with their thermal image or sound map, failed,
stopped, returned and finished patrols with the report link, health ERROR, to Telegram and a
JSON webhook; spooled on disk and retried while the uplink is down; English or Bahasa
Indonesia; `alerts/test` (`alerts`, `ALERTS`, `TELEGRAM_BOT_TOKEN`, `HOTDOG_WEBHOOK_TOKEN`).
- `PARAMS_FILE` in `/etc/hotdog/hotdog.env`: this robot's and site's parameters
(`/etc/hotdog/site.yaml`) on top of `config/stack.yaml`, so a schedule survives a restart.
- Guides: [commissioning](docs/commissioning.md) of a new M20 or substation and
Expand Down
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,17 @@ taught and repeated from the dock. The robot, its LiDARs and their drivers come

## Packages

| Package | Role |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------- |
| [`hotdog`](src/hotdog) | the robot: profile, M20 driver settings, stack config, `robot.launch.py`, `sim.launch.py` |
| [`hotdog_base`](src/hotdog_base) | both RoboSense Airy as one leveled cloud in `base_link`, the shared launch helpers |
| [`hotdog_inspection`](src/hotdog_inspection) | inspection at the stop points: overheat (UniPod MT11), partial discharge (HZ-FA-371), reports, teaching |
| [`hotdog_patrol`](src/hotdog_patrol) | patrols from the dock, on demand or on a schedule, patrol summaries, back to the dock |
| [`hotdog_reports`](src/hotdog_reports) | HTML patrol reports with the last round of every finding, retention, the report server on port 8088 |
| [`hotdog_interfaces`](src/hotdog_interfaces) | findings, inspection reports and status, `AddTarget` |
| `dharma_*` ([dharma.repos](dharma.repos)) | odometry monitor, localization, perception, routes, navigation, control mux, health |
| [m20_ros2](https://github.com/DarmawanRobotics/m20_ros2), [unipod_driver](https://github.com/DarmawanRobotics/unipod_driver), [rslidar_sdk](https://github.com/RoboSense-LiDAR/rslidar_sdk) ([external.repos](external.repos)) | M20 driver and URDF, the pod driver, the Airy driver |
| Package | Role |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------- |
| [`hotdog`](src/hotdog) | the robot: profile, M20 driver settings, stack config, `robot.launch.py`, `sim.launch.py` |
| [`hotdog_base`](src/hotdog_base) | both RoboSense Airy as one leveled cloud in `base_link`, the shared launch helpers |
| [`hotdog_inspection`](src/hotdog_inspection) | inspection at the stop points: overheat (UniPod MT11), partial discharge (HZ-FA-371), reports, teaching |
| [`hotdog_patrol`](src/hotdog_patrol) | patrols from the dock, on demand or on a schedule, patrol summaries, back to the dock |
| [`hotdog_reports`](src/hotdog_reports) | HTML patrol reports with the last round of every finding, retention, the report server on port 8088 |
| [`hotdog_alerts`](src/hotdog_alerts) | findings, patrols and health ERROR to Telegram (English or Bahasa Indonesia) and a webhook, spooled offline |
| [`hotdog_interfaces`](src/hotdog_interfaces) | findings, inspection reports and status, `AddTarget` |
| `dharma_*` ([dharma.repos](dharma.repos)) | odometry monitor, localization, perception, routes, navigation, control mux, health |
| [m20_ros2](https://github.com/DarmawanRobotics/m20_ros2), [unipod_driver](https://github.com/DarmawanRobotics/unipod_driver), [rslidar_sdk](https://github.com/RoboSense-LiDAR/rslidar_sdk) ([external.repos](external.repos)) | M20 driver and URDF, the pod driver, the Airy driver |

<details>
<summary><b>Hardware</b></summary>
Expand Down
26 changes: 17 additions & 9 deletions docs/commissioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,15 @@ scripts/setup.sh install service timesync
sudoedit /etc/hotdog/hotdog.env
```

| Variable | |
| ------------------- | -------------------------------------------------------------------- |
| `ROBOT_IP` | the M20 (`10.21.31.103`) |
| `DRIVER_PARAMS` | this robot's m20_driver file, `/etc/hotdog/m20_driver.yaml` (step 3) |
| `PARAMS_FILE` | this robot and site, `/etc/hotdog/site.yaml` (steps 5 - 8) |
| `SITE` | the site whose routes and inspection points are used |
| `POD_IP` | the UniPod MT11 |
| `HERTZINO_PASSWORD` | the acoustic camera's password (never in a parameter file) |
| Variable | |
| -------------------- | -------------------------------------------------------------------- |
| `ROBOT_IP` | the M20 (`10.21.31.103`) |
| `DRIVER_PARAMS` | this robot's m20_driver file, `/etc/hotdog/m20_driver.yaml` (step 3) |
| `PARAMS_FILE` | this robot and site, `/etc/hotdog/site.yaml` (steps 5 - 9) |
| `SITE` | the site whose routes and inspection points are used |
| `POD_IP` | the UniPod MT11 |
| `HERTZINO_PASSWORD` | the acoustic camera's password (never in a parameter file) |
| `TELEGRAM_BOT_TOKEN` | the bot that sends the alerts (step 9) |

The file is read by systemd and bash: no comments after a value, quotes around values with
spaces. `scripts/setup.sh` checks every component.
Expand Down Expand Up @@ -112,7 +113,14 @@ The dock is the origin of everything HotDog teaches:
4. Set the day's air temperature (`thermal.ambient_c`), then run the first patrol at a low
cruise speed (`path_follower_node speed.cruise: 0.3` in the site file) and check the reports.

## 9. Time
## 9. Alerts

[hotdog_alerts: Set up](../src/hotdog_alerts/README.md#set-up): the bot token in the env file,
the crew's group in `alert_node` `telegram.chat_ids` of the site file, `robot_name`,
`language: id` when the crew prefers it, and `report_url` as the crew's phones reach the
robot. `ros2 service call /alerts/test std_srvs/srv/Trigger` must arrive in the group.

## 10. Time

Every stamp comes from one clock: `scripts/setup.sh install timesync` (chrony). The Airy are
stamped on arrival here (`use_lidar_clock: false`), so they need no PTP. `health/status` warns
Expand Down
8 changes: 8 additions & 0 deletions docs/operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,14 @@ Copy a day off the robot with its images: `scp -r robot@<ip>:~/.hotdog/reports/<
Days older than a year, and the oldest days when less than 5 GB is free, are deleted on the
robot ([hotdog_reports](../src/hotdog_reports/README.md#retention)).

## Alerts

The crew's Telegram group gets every **warning** and **critical** finding with its thermal
image or sound map, every patrol that failed or came back on its own, every finished patrol
with a link to its report, and a robot whose health is ERROR. Act on the last line of a
finding alert; a repeated finding stays quiet for 12 h unless it gets worse. Without uplink
the alerts wait on the robot and arrive when the link is back.

## Emergency stop

- **Hard:** the M20's own e-stop or remote; the driver holds `cmd_vel` until `stand_up`.
Expand Down
3 changes: 2 additions & 1 deletion scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ env_template() {
'ROBOT_NS=m20' 'ROBOT_DRIVER=m20_bringup' 'ROBOT_IP=10.21.31.103' 'DRIVER_PARAMS=' \
'PARAMS_FILE=' \
'LIDAR=rslidar' 'SITE=' "SITES_DIR=$HOME/.hotdog/sites" 'POD_IP=' 'HERTZINO_PASSWORD=' \
'TELEGRAM_BOT_TOKEN=' 'HOTDOG_WEBHOOK_TOKEN=' \
'OPENBLAS_NUM_THREADS=1' 'OMP_NUM_THREADS=1'
}
service_unit() {
Expand Down Expand Up @@ -217,7 +218,7 @@ check_service() {
install_service() {
if [[ ! -f "$ENV_FILE" ]]; then
env_template | $SUDO install -D -m 640 -g "$(id -gn)" /dev/stdin "$ENV_FILE"
log "created $ENV_FILE: set ROBOT_IP, SITE, DRIVER_PARAMS, PARAMS_FILE, POD_IP, HERTZINO_PASSWORD"
log "created $ENV_FILE: set ROBOT_IP, SITE, DRIVER_PARAMS, PARAMS_FILE, POD_IP, HERTZINO_PASSWORD, TELEGRAM_BOT_TOKEN"
fi
service_unit | $SUDO tee "$SERVICE_FILE" > /dev/null
$SUDO systemctl daemon-reload
Expand Down
1 change: 1 addition & 0 deletions src/hotdog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ ros2 launch hotdog sim.launch.py rviz:=true scenario:=person_crossing
| `camera_image` / `camera_info` | | empty: the perception defaults |
| `health` | `true` | start the health monitor |
| `inspection` / `patrol` | `true` (`INSPECTION`, `PATROL`) | inspection_node, patrol_node |
| `alerts` | `true` (`ALERTS`) | alert_node: Telegram and webhook alerts |
| `reports` | `true` (`REPORTS`) | report_node: HTML reports, retention, the report server (port 8088) |
| `world` / `scenario` / `rviz` | / / `false` | simulator only |

Expand Down
6 changes: 6 additions & 0 deletions src/hotdog/hotdog/launch_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@
'true',
'HTML reports, retention and the report server on port 8088 (report_node)',
),
'alerts': (
'ALERTS',
'true',
'Telegram and webhook alerts (alert_node; TELEGRAM_BOT_TOKEN, telegram.chat_ids)',
),
'pod': ('POD', 'true', 'unipod_driver for the UniPod MT11 (gimbal, cameras, temperatures)'),
'pod_ip': ('POD_IP', '', 'the UniPod MT11; empty: unipod_driver default (10.21.31.26)'),
'fiducials': (None, 'false', 'camera throttle + tag detector'),
Expand Down Expand Up @@ -116,6 +121,7 @@ def resolve(arg, sim: bool = False):
inspection=bringup.truthy(arg('inspection')),
patrol=bringup.truthy(arg('patrol')),
reports=bringup.truthy(arg('reports')),
alerts=bringup.truthy(arg('alerts')),
pod=False if sim else bringup.truthy(arg('pod')),
)
data = bringup.merge_files(files)
Expand Down
4 changes: 4 additions & 0 deletions src/hotdog/hotdog/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class Options:
pod: bool = True # unipod_driver for the UniPod MT11
patrol: bool = True # patrol_node: patrols from the dock, on demand or on a schedule
reports: bool = True # report_node: HTML reports, retention, the report server
alerts: bool = True # alert_node: Telegram and webhook alerts


# component -> (package, launch file, nodes it starts, by node name)
Expand Down Expand Up @@ -88,6 +89,7 @@ class Options:
'inspection': ('hotdog_inspection', 'inspection.launch.py', ('inspection_node',)),
'patrol': ('hotdog_patrol', 'patrol.launch.py', ('patrol_node',)),
'reports': ('hotdog_reports', 'reports.launch.py', ('report_node',)),
'alerts': ('hotdog_alerts', 'alerts.launch.py', ('alert_node',)),
}
RSLIDAR_NODE = 'rslidar_sdk_node' # reads its own file (config/rslidar.yaml), no parameters
POD_NAMESPACE = 'unipod'
Expand Down Expand Up @@ -139,6 +141,7 @@ def component_arguments(o: Options) -> dict:
'inspection': {'sites_dir': o.sites_dir},
'patrol': {'robot_ns': o.robot_ns, 'sites_dir': o.sites_dir},
'reports': {},
'alerts': {},
}


Expand All @@ -149,6 +152,7 @@ def components(o: Options, sim: bool = False) -> list[str]:
'inspection': o.inspection,
'patrol': o.patrol,
'reports': o.reports,
'alerts': o.alerts,
}
return [
name for name in COMPONENTS if wanted.get(name, True) and not (sim and name in ROBOT_ONLY)
Expand Down
1 change: 1 addition & 0 deletions src/hotdog/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<exec_depend>hotdog_inspection</exec_depend>
<exec_depend>hotdog_patrol</exec_depend>
<exec_depend>hotdog_reports</exec_depend>
<exec_depend>hotdog_alerts</exec_depend>
<exec_depend>unipod_driver</exec_depend>

<test_depend>python3-pytest</test_depend>
Expand Down
1 change: 1 addition & 0 deletions src/hotdog/test/ros/test_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
'hotdog_inspection',
'hotdog_patrol',
'hotdog_reports',
'hotdog_alerts',
'm20_bringup',
'unipod_driver',
)
Expand Down
2 changes: 2 additions & 0 deletions src/hotdog/test/unit/test_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ def test_every_component_in_order():
'hotdog_inspection',
'hotdog_patrol',
'hotdog_reports',
'hotdog_alerts',
]
assert 'dharma_health' not in by_package(stack.compose(options(health=False)))
assert 'hotdog_inspection' not in by_package(stack.compose(options(inspection=False)))
assert 'hotdog_patrol' not in by_package(stack.compose(options(patrol=False)))
assert 'hotdog_reports' not in by_package(stack.compose(options(reports=False)))
assert 'hotdog_alerts' not in by_package(stack.compose(options(alerts=False)))
assert 'hotdog_base' not in by_package(stack.compose(options(), sim=True))


Expand Down
Loading
Loading