Demo VSCode repository with all dependencies to connect to a PostgreSQL database with data stored as PostGIS elements.
The postgis_ros_bridge
publisher node is used to fetch data from the database and publish it as ROS2 messages.
- Checkout repository and open in VSCode
- Open in devcontainer
- Run tasks:
import from workspace file
install dependencies
build
source ros
For detailed info, see Section Setup - Detailed Step-by-Step
To start the demo (after sucessfully set up the workspace), the demo can be launched using:
cd /workspaces/postgis_ros_bridge_demo_workspace/
source install/setup.bash
ros2 launch postgis_ros_bridge_demo gravel_quarry.launch.py
The launchfile starts the bridge itself, the needed transformations for visualization, a transformer node to convert gps messages to odometry (for visualization) and rviz2.
To visualize "live" data in this demo, play back the bagfile in src/postgis_ros_bridge_demo/data/roscon_demo
via:
ros2 bag play src/postgis_ros_bridge_demo/data/roscon_demo
Th result should look as follows:
To run the demo with foxglove, use
ros2 launch postgis_ros_bridge_demo gravel_quarry.launch.py foxglove:=true rviz:=false
in foxglove:
- Connect to
ws://localhost:8765
- Load Layout (In top bar:
Layout->Import from file
) from/workspaces/postgis_ros_bridge_demo_workspace/src/postgis_ros_bridge_demo/rviz/gravel quarry.json
- Set
ROS_PACKAGE_PATH
underProfile->Settings
to/workspaces/postgis_ros_bridge_demo_workspace/install/share
(needed to find meshes)
The result should look as follows:
Clone this repository using
git clone https://github.com/AIT-Assistive-Autonomous-Systems/postgis_ros_bridge_demo_workspace.git
and open it in VSCode
cd postgis_ros_bridge_demo_workspace && code .
When you open it for the first time, you should see a little popup that asks you if you would like to open it in a container. Say yes!
If you don't see the pop-up, click on the little green square in the bottom left corner, which should bring up the container dialog
In the dialog, select "Remote Containers: Reopen in container"
VSCode will build the dockerfile inside of .devcontainer
for you. If you open a terminal inside VSCode (Terminal->New Terminal), you should see that your username has been changed to ros
, and the bottom left green corner should say "Dev Container"
To check out the repos in the src folder, run the task via Terminal->Run Task..->import from workspace file
After this, the folder src
should contain a folder postgis_ros_bridge
Install the dependencies using Terminal->Run Task..->install dependencies
To build the workspace, run Terminal->Run Task..->build
and to setup the ROS environment, run Terminal->Run Task..->source ros
By default, the devcontainer loads the althack/ros2:humble-full
image as basis. If no GUI inside the container is needed (e.g., already setup ROS2 environment on host system, warning: incompatible message definition between different ROS distros may occur), the althack/ros2:humble-dev
can be used to have smaller images.
A common issue within the docker trying to start a GUI-application like rviz
is the following:
/workspaces/postgis_ros_bridge_demo_workspace$ rviz2
No protocol specified
qt.qpa.xcb: could not connect to display :2
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
Aborted (core dumped)
If this happens, the connection to the display cannot be set up. To enable the user of the devcontainer to write to your X-Server, an option is to disable the server access control program for X xhost at the host system:
sudo xhost +
Warning: Be aware of possible security issues and side-effect depending on your setup, see xhost manual.
- "wheel loader" (https://skfb.ly/6vNp6) by Anton Sereda is licensed under Creative Commons Attribution-NonCommercial (http://creativecommons.org/licenses/by-nc/4.0/).
- "Power Transmission Line" (https://skfb.ly/oozIK) by combine_soldier is licensed under Creative Commons Attribution (http://creativecommons.org/licenses/by/4.0/).
[DE] Die FFG ist die zentrale nationale Förderorganisation und stärkt Österreichs Innovationskraft. Dieses Projekt wird aus Mitteln der FFG gefördert.
[EN] FFG is the central national funding organization and strengthens Austria's innovative power. This project is funded by the FFG.
Projekt: openSCHEMA