Skip to content

Commit 5041f35

Browse files
committed
update with test and better readme
1 parent cd3bf3e commit 5041f35

File tree

4 files changed

+43
-99
lines changed

4 files changed

+43
-99
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ include_directories(
1515
install(
1616
PROGRAMS
1717
scripts/start_qgis_ros
18+
scripts/navsatfix
1819
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
1920
)
2021

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
# QGIS-ROS
2+
3+
**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!**
4+
25
A QGIS plugin for interacting with data from ROS topics and bags.
36

47
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
58

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

1418
## Installation (source)
19+
1520
```bash
1621
cd ~/my_ros_ws/src/
1722
git clone [email protected]:locusrobotics/qgis_ros.git
18-
git clone [email protected]/clearpathrobotics/wireless.git
23+
git clone [email protected]:clearpathrobotics/wireless.git
1924
git clone [email protected]:locusrobotics/json_transport.git
2025
catkin build
2126

@@ -24,19 +29,22 @@ pip3 install -r requirements.txt
2429
```
2530

2631
## Usage (source)
32+
2733
```bash
2834
rosrun qgis_ros start_qgis_ros
2935
```
3036

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

3339
With custom ROS Message Translators:
40+
3441
```bash
3542
export QGIS_ROS_EXTRA_TRANSLATORS='custompythonmodule.translators'
3643
rosrun qgis_ros start_qgis_ros
3744
```
3845

3946
## Usage (docker)
47+
4048
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.
4149

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

5462
## ROS Message Translators
63+
5564
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:
5665

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

6675
### My topic does not appear in the list of topics
76+
6777
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.
6878
51
6979

70-
7180
## Contributions
81+
7282
Contributions are appreciated. Please open a pull request.
7383

7484
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.
7585

7686
## Contact
87+
7788
Queries that don't fit well as GitHub issues can be directed to Andrew Blakey at [email protected]
7889

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

81-
8292
[1]: https://qgis.org/en/site/forusers/download.html
8393
[2]: http://wiki.ros.org/docker/Tutorials/GUI

SCRATCHPAD.py

Lines changed: 0 additions & 96 deletions
This file was deleted.

scripts/navsatfix_test_pub

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env python3
2+
"""
3+
An example publisher of basic NavSatFix data, mostly for testing.
4+
"""
5+
from random import random
6+
7+
import rospy
8+
from sensor_msgs.msg import NavSatFix
9+
10+
11+
def navsatfix_test_pub():
12+
pub = rospy.Publisher("navsat", NavSatFix, queue_size=1)
13+
rospy.init_node("navsatfix_test_pub")
14+
15+
rate = rospy.Rate(1)
16+
17+
longitude = 0
18+
19+
while not rospy.is_shutdown():
20+
pub.publish(latitude=0, longitude=longitude)
21+
longitude += random()
22+
rate.sleep()
23+
24+
25+
if __name__ == "__main__":
26+
try:
27+
navsatfix_test_pub()
28+
except rospy.ROSInterruptException:
29+
pass

0 commit comments

Comments
 (0)