Giter Site home page Giter Site logo

openmower-gui's Introduction

OpenMower GUI

A GUI for the OpenMower project.

Demo

https://youtu.be/x45rdy4czQ0

Installation

If you are using Mowgli-Docker

If you are using mowgli-docker, you can skip this part as it's now included in the docker-compose file.

If your are using OpenMowerOS

OpenMowerOS uses podman and containers are managed by systemd.

First, create the /boot/openmower/db directory :

mkdir /boot/openmower/db

Create a gui.service file in /etc/systemd/system/ with the following content:

[Unit]
Description=Podman container - gui.service
Documentation=man:podman-generate-systemd(1)
Wants=network.target
After=network-online.target NetworkManager.service
StartLimitInterval=120
StartLimitBurst=10

[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Type=forking
Restart=always
RestartSec=15s
TimeoutStartSec=1h
TimeoutStopSec=120s

ExecStartPre=/bin/rm -f %t/container-gui.pid %t/container-gui.ctr-id

ExecStart=/usr/bin/podman run --conmon-pidfile %t/container-gui.pid --cidfile %t/container-gui.ctr-id --cgroups=no-conmon \
  --replace --detach --tty --privileged \
  --name openmower-gui \
  --network=host \
  --env MOWER_CONFIG_FILE=/config/mower_config.sh \
  --env DOCKER_HOST=unix:///run/podman/podman.sock \
  --env ROS_MASTER_URI=http://localhost:11311 \
  --volume /dev:/dev \
  --volume /run/podman/podman.sock:/run/podman/podman.sock \
  --volume /boot/openmower/db:/app/db \
  --volume /boot/openmower/mower_config.txt:/config/mower_config.sh \
  --label io.containers.autoupdate=image \
  ghcr.io/cedbossneo/openmower-gui:master

#ExecStartPost=/usr/bin/podman image prune --all --force

ExecStop=/usr/bin/podman stop --ignore --cidfile %t/container-gui.ctr-id -t 10
ExecStopPost=/usr/bin/podman rm --ignore --force --cidfile %t/container-gui.ctr-id
PIDFile=%t/container-gui.pid

[Install]
WantedBy=multi-user.target default.target

Then enable and start the service:

sudo systemctl enable gui.service
sudo systemctl start gui.service

Usage

Once the container is running, you can access the GUI by opening a browser and going to http://<ip of the machine running the container>:4006

HomeKit

The password to use OpenMower in iOS home app is 00102003 Do not forget to set env var HOMEKIT_ENABLED to true

MQTT

MQTT server is listening on port 1883

See ros.ts for topic types

Available topics :

  • /gui/mower_logic/current_state
  • /gui/mower/status
  • /gui/xbot_positioning/xb_pose
  • /gui/imu/data_raw
  • /gui/mower/wheel_ticks
  • /gui/xbot_monitoring/map
  • /gui/slic3r_coverage_planner/path_marker_array
  • /gui/move_base_flex/FTCPlanner
  • /gui/mowing_path

Available commands :

Do not forget to set env var MQTT_ENABLED to true

Env variables

  • MOWER_CONFIG_FILE=mower_config.sh : config file location
  • DOCKER_HOST=unix:///var/run/docker.sock : socker socket
  • ROS_MASTER_URI=http://localhost:11311 : ros master uri
  • ROS_NODE_NAME=openmower-gui : node name
  • ROS_NODE_HOST=:4006 : listening port
  • MQTT_ENABLED=true : enable mqtt
  • MQTT_HOST=:1883 : listening port
  • HOMEKIT_ENABLED=true : enable homekit
  • MAP_TILE_SERVER=http://localhost:5000 : custom map tile server (see https://github.com/2m/openmower-map-tiles for usage)
  • MAP_TILE_URI=/tiles/vt/lyrs=s,h&x={x}&y={y}&z={z}

openmower-gui's People

Contributors

alexvaut avatar cedbossneo avatar dependabot[bot] avatar fredericve avatar jkaflik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

openmower-gui's Issues

Map offset not saved

X and Y offset for maps is not saved/applied. When I move the cursor for X for 2 meters, it moves the map, and then it jumps back to 0. This stopped working about a week ago.

Error: Invalid LngLat object: (NaN, NaN)

Today I updated openmower-gui. Now can't see the map. In JS console I see after "PATH Stream connected" this error:

index-4c85440c.js:628 Error: Invalid LngLat object: (NaN, NaN)
at new po (mapbox-gl-fb74844c.js:8:78577)
at po.convert (mapbox-gl-fb74844c.js:8:79468)
at uo.setSouthWest (mapbox-gl-fb74844c.js:8:61980)
at new uo (mapbox-gl-fb74844c.js:8:61783)
at uo.convert (mapbox-gl-fb74844c.js:8:63382)
at Map.cameraForBounds (mapbox-gl-fb74844c.js:1311:151652)
at Map.fitBounds (mapbox-gl-fb74844c.js:1311:156012)
at new Map (mapbox-gl-fb74844c.js:1316:13498)
at nu._initialize (index-4c85440c.js:628:98602)
at new nu (index-4c85440c.js:628:97237)

Openmower GUI estimated charge time

With so much info in the Openmower GUI, i wonder would it be possible to add an estimated time to fully charged?
Additionally this could be extended so that if automow is enabled and the mower is planned to go back out that the estimated time of the next mow is shown. This would be a good feedback to have so as to plan around weather or potentially a time to complete.

add possibility to trigger manual pause mowing from the UI

It would be super helpful to be able to set/unset following flag:

root@openmower:/opt/open_mower_ros# rosrun dynamic_reconfigure dynparam set /mower_logic manual_pause_mowing false
root@openmower:/opt/open_mower_ros# rosrun dynamic_reconfigure dynparam set /mower_logic manual_pause_mowing true

I often use this to pause mowing for the night and resume in the morning.

Thanks!

Obstacles ignored

Obstacles added in the map editor are ignored. In Flutter Demo they are also shown (or hidden) behind mowing areas, instead of being on top.

Saving config removes other values

Hi. When I saved the config other settings like hardware-version and others are missing. Only after adding
export OM_HARDWARE_VERSION="0_13_X"
export OM_MOWER="YardForce500"
export OM_MOWER_ESC_TYPE="xesc_mini"
export OM_GPS_BAUDRATE="921600"
export OM_AUTOMATIC_START="false"

the mower worked again.
I am using version alpha.

Some connections do not recover when openmower service is restarted

When debugging things I quite often want to clear current openmower state and thus restart the openmower service.

I noticed that some parts of the openmower-gui loose connection with the mower when the openmower service is restarted. I see the following in the openmower-gui logs:

[2023/09/11 16:01:19] [ERROR] subscriber '/move_base_flex/FTCPlanner/global_plan' got an error: Post "http://openmower:33465/RPC2": dial tcp 127.0.1.1:33465: connect: connection refused
[2023/09/11 16:01:19] [ERROR] subscriber '/xbot_monitoring/map' got an error: Post "http://openmower:44851/RPC2": dial tcp 127.0.1.1:44851: connect: connection refused
[2023/09/11 16:01:24] [ERROR] subscriber '/move_base_flex/FTCPlanner/global_plan' got an error: Post "http://openmower:33465/RPC2": dial tcp 127.0.1.1:33465: connect: connection refused
[2023/09/11 16:01:24] [ERROR] subscriber '/slic3r_coverage_planner/path_marker_array' got an error: Post "http://openmower:37051/RPC2": dial tcp 127.0.1.1:37051: connect: connection refused
[2023/09/11 16:01:24] [ERROR] subscriber '/imu/data_raw' got an error: Post "http://openmower:41187/RPC2": dial tcp 127.0.1.1:41187: connect: connection refused
[2023/09/11 16:01:24] [ERROR] subscriber '/mower/status' got an error: Post "http://openmower:41187/RPC2": dial tcp 127.0.1.1:41187: connect: connection refused
[2023/09/11 16:01:24] [ERROR] subscriber '/xbot_positioning/xb_pose' got an error: Post "http://openmower:41039/RPC2": dial tcp 127.0.1.1:41039: connect: connection refused
[2023/09/11 16:01:24] [ERROR] subscriber '/mower/wheel_ticks' got an error: Post "http://openmower:41187/RPC2": dial tcp 127.0.1.1:41187: connect: connection refused
[2023/09/11 16:01:24] [ERROR] subscriber '/xbot_monitoring/map' got an error: Post "http://openmower:44851/RPC2": dial tcp 127.0.1.1:44851: connect: connection refused
[2023/09/11 16:01:24] [ERROR] subscriber '/mower_logic/current_state' got an error: Post "http://openmower:46343/RPC2": dial tcp 127.0.1.1:46343: connect: connection refused

Raspberry Pi Temperature

Hey Cedric, Just wondering if the pi temperature could be included in the GUI? Might be worthwhile as a to monitor in hot climates.

Cannot see containers

Very nice ! I already run it on my openmower it works fine except the container part. I can connect to podman socket with --volume /run/podman/podman.sock:/run/podman/podman.sock --env DOCKER_HOST=unix:///run/podman/podman.sock; I also added the label project=openmower to the openmower container but the openmower container doesn't show up in the UI. it is just empty... Any idea what I'm missing ? There are no erros in the openmower-gui container.

Command used:

sudo /usr/bin/podman run \
  --replace --detach --tty --privileged \
  --name openmower-gui \
  --network=host \
  --volume /run/podman/podman.sock:/run/podman/podman.sock \
  --volume /boot/openmower/mower_config.txt:/config/mower_config.sh \
  --env MOWER_CONFIG_FILE=/config/mower_config.sh \
  --env DOCKER_HOST=unix:///run/podman/podman.sock  \
  --env ROS_MASTER_URI=http://192.168.1.50:11311 \
  local/openmower-ui:latest

image
image

iOS HomeKit - won't connect

After restarting the iOS device and enabling HomeKit in openmower-GUI, openmower appears in the list of available devices, however the attempt to connect with pincode 00102003 fails. Unable to add accessory msg appears.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.