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
42 changes: 42 additions & 0 deletions .github/workflows/industrial_ci_action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Copyright (C) 2024 Nobleo Autonomous Solutions B.V.
#
# SPDX-License-Identifier: Apache-2.0

# This config uses industrial_ci (https://github.com/ros-industrial/industrial_ci.git).
# For troubleshooting, see README (https://github.com/ros-industrial/industrial_ci/blob/master/README.rst)

name: ros-industrial

on:
push:
pull_request:
workflow_dispatch:

jobs:
industrial_ci:
name: ROS ${{ matrix.ROS_DISTRO }} (${{ matrix.ROS_REPO }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ROS_DISTRO:
- humble
- jazzy
- kilted
- rolling
ROS_REPO:
- main
env:
CCACHE_DIR: "${{ github.workspace }}/.ccache"
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ matrix.ROS_DISTRO }}-${{ matrix.ROS_REPO }}-${{github.run_id}}
restore-keys: |
ccache-${{ matrix.ROS_DISTRO }}-${{ matrix.ROS_REPO }}-
- uses: 'ros-industrial/industrial_ci@master'
env:
ROS_DISTRO: ${{ matrix.ROS_DISTRO }}
ROS_REPO: ${{ matrix.ROS_REPO }}
15 changes: 15 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: pre-commit

on:
pull_request:
push:

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
- uses: pre-commit/action@v3.0.1
with:
extra_args: --all-files --verbose
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (C) 2025 Nobleo Autonomous Solutions B.V.

repos:
- repo: https://bitbucket.org/nobleo/nobleo-pre-commit
rev: 25.4.0
hooks:
- id: nobleo-hooks
verbose: true
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ set_property(TARGET ${PROJECT_NAME} PROPERTY AUTOMOC ON)


if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
find_package(ament_cmake_gtest REQUIRED)

ament_add_gtest(test_field test/test_field.cpp)
Expand Down
55 changes: 33 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,54 +33,65 @@ Where the tokens `{z}`, `{x}`, `{y}` represent the zoom level, x coordinate, and
These will automatically be substituted by rviz_satellite when making HTTP requests.

Tiles can optionally be loaded from a local filesystem if downloaded beforehand
for cases where robots do not have internet access. For example, the file URI
for cases where robots do not have internet access.
For example, the file URI
`file:///tmp/tile/{z}/{y}/{x}.jpg` can be used to load files from the `/tmp/tile` directory.

rviz_satellite doesn't come with any preconfigured tile URL.
For example, you could use one of the following tile servers:

* OpenStreetMap: https://tile.openstreetmap.org/{z}/{x}/{y}.png
* TomTom: https://api.tomtom.com/map/1/tile/basic/main/{z}/{x}/{y}.png?tileSize=512&key=[TOKEN]
* Mapbox: https://api.mapbox.com/styles/v1/mapbox/satellite-v9/tiles/256/{z}/{x}/{y}?access_token=[TOKEN]
* OpenStreetMap: <https://tile.openstreetmap.org/{z}/{x}/{y}.png>
* TomTom: <https://api.tomtom.com/map/1/tile/basic/main/{z}/{x}/{y}.png?tileSize=512&key=[TOKEN>]
* Mapbox: <https://api.mapbox.com/styles/v1/mapbox/satellite-v9/tiles/256/{z}/{x}/{y}?access_token=[TOKEN>]

For some of these, you have to request an access token first.
Please refer to the respective terms of service and copyrights.

## Options

- `Topic` is the topic of the GPS measurements.
- `Alpha` is simply the display transparency.
- `Draw Behind` will cause the map to be displayed below all other geometry.
- `Zoom` is the zoom level of the map. Recommended values are 16-19, as anything smaller is _very_ low resolution. 22 is the current max.
- `Blocks` number of adjacent tiles in addition to the center tile to load, 8 maximum.
- `Timeout` specifies a timeout since the last received message timestamp, after which the map will be faded out; disable by setting to 0.
* `Topic` is the topic of the GPS measurements.
* `Alpha` is simply the display transparency.
* `Draw Behind` will cause the map to be displayed below all other geometry.
* `Zoom` is the zoom level of the map.
Recommended values are 16-19, as anything smaller is _very_ low resolution. 22 is the current max.
* `Blocks` number of adjacent tiles in addition to the center tile to load, 8 maximum.
* `Timeout` specifies a timeout since the last received message timestamp, after which the map will be faded out; disable by setting to 0.

## Local Maps

If you want to use a tile server which only supports a specific region instead of the whole world you can enable the `Use Local Map` option. This also means that the zoom levels and tile coverage (see [here](https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#Zoom_levels)) deviate and need to be defined manually. In particular, the `local origin` is the top-left corner of the local map region.
If you want to use a tile server which only supports a specific region instead of the whole world you can enable the `Use Local Map` option.
This also means that the zoom levels and tile coverage (see [here](https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#Zoom_levels)) deviate and need to be defined manually.
In particular, the `local origin` is the top-left corner of the local map region.

The options can be set after unfolding the top-level `Use Local Map` option:

- `Meter per Pixel (Zoom 0)` defines the length of a pixel edge in the image in meter at zoom level 0. Default is 0.0.
- `Origin CRS` is the [epsg code](https://epsg.io/) of the coordinate reference system (CRS) of the local origin (should be a cartesian coordinate system). Default is not set.
- `Origin X` is the X position of the local origin in given CRS system. Default is 0.0.
- `Origin Y` is the Y position of the local origin in given CRS system. Default is 0.0.
* `Meter per Pixel (Zoom 0)` defines the length of a pixel edge in the image in meter at zoom level 0.
Default is 0.0.
* `Origin CRS` is the [epsg code](https://epsg.io/) of the coordinate reference system (CRS) of the local origin (should be a cartesian coordinate system).
Default is not set.
* `Origin X` is the X position of the local origin in given CRS system.
Default is 0.0.
* `Origin Y` is the Y position of the local origin in given CRS system.
Default is 0.0.

### Example Usage

Public orthographic photos are povided by [Geobasis NRW](https://www.bezreg-koeln.nrw.de/geobasis-nrw/webdienste/geodatendienste) and publicly available using the scheme described [here](https://www.wmts.nrw.de/geobasis/wmts_nw_dop/tiles/nw_dop/EPSG_25832_16/1.0.0/WMTSCapabilities.xml). The tiles only cover a smaller part of western Germany but have a very high resolution. The following options can be used and directly derived from the scheme.
Public orthographic photos are povided by [Geobasis NRW](https://www.bezreg-koeln.nrw.de/geobasis-nrw/webdienste/geodatendienste) and publicly available using the scheme described [here](https://www.wmts.nrw.de/geobasis/wmts_nw_dop/tiles/nw_dop/EPSG_25832_16/1.0.0/WMTSCapabilities.xml).
The tiles only cover a smaller part of western Germany but have a very high resolution.
The following options can be used and directly derived from the scheme.

- `Object URI: https://www.wmts.nrw.de/geobasis/wmts_nw_dop/tiles/nw_dop/EPSG_25832_16/{z}/{x}/{y}`
- `Meter per Pixel (Zoom 0): 4891.97`
- `Origin CRS: EPSG:25832`
- `Origin X: -46133.17`
- `Origin Y: 6301219.54`
* `Object URI: https://www.wmts.nrw.de/geobasis/wmts_nw_dop/tiles/nw_dop/EPSG_25832_16/{z}/{x}/{y}`
* `Meter per Pixel (Zoom 0): 4891.97`
* `Origin CRS: EPSG:25832`
* `Origin X: -46133.17`
* `Origin Y: 6301219.54`

## Support and Contributions

In case of questions or problems, do not hesitate to open an issue.

Contributions are welcomed. Please add a summary of your changes to the [changelog](CHANGELOG.rst) under the section Forthcoming.
Contributions are welcomed.
Please add a summary of your changes to the [changelog](CHANGELOG.rst) under the section Forthcoming.

## Icon copyright

Expand Down
21 changes: 13 additions & 8 deletions demo/publish_demo_data
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@
"""
Periodically publish gps positions in a circle around a given origin as NavSatFix messages.
"""
import rclpy

import math
import numpy as np
from argparse import ArgumentParser
from sensor_msgs.msg import NavSatFix, NavSatStatus

import numpy as np
import rclpy
from sensor_msgs.msg import NavSatFix, NavSatStatus

CONVERSION_CONSTANT = 1e9

class CircularTranslate():

class CircularTranslate:
"""Translate fix periodically in a circle"""

def update(self, t, fix):
Expand All @@ -23,8 +25,9 @@ class CircularTranslate():
fix.longitude += math.sin(phi) * r


class ApplyNoise():
class ApplyNoise:
"""Translate fix position using gaussian noise"""

def __init__(self, stddev):
self.stddev = stddev

Expand All @@ -34,8 +37,9 @@ class ApplyNoise():
fix.longitude += noise[1]


class LooseFix():
class LooseFix:
"""Set NavSatFix status to NO_FIX periodically"""

def __init__(self, phase, period):
self.phase = phase
self.period = period
Expand Down Expand Up @@ -76,13 +80,14 @@ def main():
fix = NavSatFix()
t = node.get_clock().now()
fix.header.stamp = t.to_msg()
fix.header.frame_id = "gps_sensor"
fix.header.frame_id = 'gps_sensor'
fix.latitude = origin.latitude
fix.longitude = origin.longitude
for u in updaters:
u.update(t, fix)
node.get_logger().info(
f'Publishing NavSatFix at ({fix.latitude:.5f}, {fix.longitude:.5f})')
f'Publishing NavSatFix at ({fix.latitude:.5f}, {fix.longitude:.5f})'
)
publisher.publish(fix)

node.create_timer(0.1, timer_callback)
Expand Down
3 changes: 1 addition & 2 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
<build_depend>qtbase5-dev</build_depend>

<test_depend>ament_cmake_gtest</test_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<export>
<rviz plugin="plugin_description.xml"/>
<build_type>ament_cmake</build_type>
Expand Down
2 changes: 1 addition & 1 deletion plugin_description.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
</description>
<message_type>sensor_msgs/msg/NavSatFix</message_type>
</class>
</library>
</library>
Loading
Loading