Skip to content

Commit

Permalink
update with test and better readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ablakey committed Sep 13, 2023
1 parent cd3bf3e commit 5041f35
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 99 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ include_directories(
install(
PROGRAMS
scripts/start_qgis_ros
scripts/navsatfix
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

Expand Down
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# QGIS-ROS

**Warning: This package is not currently maintained and may not work without some additional technical care. It looks like a newer version of QGIS has changed a bunch of the Python interfaces. Try using QGIS 3.10 or perhaps a bit older. PRs are welcome!**

A QGIS plugin for interacting with data from ROS topics and bags.

The ROSCon 2018 Presentation on QGIS-ROS can be found here: https://vimeo.com/293539252. The presentation PDF can be found here: https://roscon.ros.org/2018/presentations/ROSCon2018_UnleashingGISToolbox.pdf

## Requirements

- Ubuntu >= 16.04
- Python 3.5
- QGIS >= 3.1
Expand All @@ -12,10 +16,11 @@ The ROSCon 2018 Presentation on QGIS-ROS can be found here: https://vimeo.com/29
QGIS can be installed from [the QGIS download page.][1] You need to add a PPA if using Ubuntu 16.04.

## Installation (source)

```bash
cd ~/my_ros_ws/src/
git clone [email protected]:locusrobotics/qgis_ros.git
git clone [email protected]/clearpathrobotics/wireless.git
git clone [email protected]:clearpathrobotics/wireless.git
git clone [email protected]:locusrobotics/json_transport.git
catkin build

Expand All @@ -24,19 +29,22 @@ pip3 install -r requirements.txt
```

## Usage (source)

```bash
rosrun qgis_ros start_qgis_ros
```

Once QGIS is loaded, navigate to Plugins -> Installed -> and enable QGIS_ROS with the checkbox. You only need to do this once.

With custom ROS Message Translators:

```bash
export QGIS_ROS_EXTRA_TRANSLATORS='custompythonmodule.translators'
rosrun qgis_ros start_qgis_ros
```

## Usage (docker)

It can often be very tricky to comfortably resolve all dependencies in your workspace because of the combination of ROS1, Python3, GDAL 2, and QGIS.

It uses a lazy/reckless way to expose X server to the container. For alternatives, check out the [ROS Docker GUI Tutorial][2].
Expand All @@ -52,6 +60,7 @@ xhost -local:root # Remember to remove X server permissions after!
To use extra translators, you'll need to mount a volume with them and/or extend the image.

## ROS Message Translators

QGIS is able to read and write data from hundreds of formats and sources by translating these formats into a common in-memory format. In order to represent ROS messages in this format, we target common interchange formats (GeoJSON and GeoTIFF) to make it easy to extend. If you want to make use of a custom ROS message type, all you have to do is:

1. subclass `qgis_ros.core.translators.Translator`
Expand All @@ -64,20 +73,21 @@ Check out the source code for more details.
## Troubleshooting

### My topic does not appear in the list of topics

Only topics that have ROS Message Translators will appear. Not every message has been implemented. If your message is custom, look above for how to create a custom translator. If it is standard to ROS, create an issue or raise a Pull Request with a new one.TODO: add an example to the ROSCon presentation repository and link here.
51


## Contributions

Contributions are appreciated. Please open a pull request.

Developers will notice that `camelCase` is being used in Python. This may seem unusual, but PyQT and QGIS both use `camelCase`.So we follow that standard in accordance with PEP8.

## Contact

Queries that don't fit well as GitHub issues can be directed to Andrew Blakey at [email protected]

Being a robogeographer is a lonely life. If there are any others out there, don't hesitate to say hi!


[1]: https://qgis.org/en/site/forusers/download.html
[2]: http://wiki.ros.org/docker/Tutorials/GUI
96 changes: 0 additions & 96 deletions SCRATCHPAD.py

This file was deleted.

29 changes: 29 additions & 0 deletions scripts/navsatfix_test_pub
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env python3
"""
An example publisher of basic NavSatFix data, mostly for testing.
"""
from random import random

import rospy
from sensor_msgs.msg import NavSatFix


def navsatfix_test_pub():
pub = rospy.Publisher("navsat", NavSatFix, queue_size=1)
rospy.init_node("navsatfix_test_pub")

rate = rospy.Rate(1)

longitude = 0

while not rospy.is_shutdown():
pub.publish(latitude=0, longitude=longitude)
longitude += random()
rate.sleep()


if __name__ == "__main__":
try:
navsatfix_test_pub()
except rospy.ROSInterruptException:
pass

0 comments on commit 5041f35

Please sign in to comment.