Skip to content

AIT-Assistive-Autonomous-Systems/postgis_ros_bridge_demo_workspace

Repository files navigation

GitHub GitHub Workflow Status (with event) GitHub issues

GitHub GitHub Workflow Status (with event) GitHub Workflow Status (with event) GitHub Workflow Status (with event) GitHub issues

PostGIS PostGIS

PostGIS ROS2 Bridge - Demo Workspace

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.

Setup tl;dr

  • Checkout repository and open in VSCode
  • Open in devcontainer
  • Run tasks:
    1. import from workspace file
    2. install dependencies
    3. build
    4. source ros

For detailed info, see Section Setup - Detailed Step-by-Step

Demo - Gravel Quarry with OpenStreetMap data integration

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:

Top-down view of a gravel quarry with semantic data from OSM as ROS2 marker visualized in rviz2. Bird's eye view on gravel quarry with zoom to powerline visualization (ROS2 marker). Same rviz2 visualization with added odometry history from rosbag (demo for "live" usecase).

Demo - with foxglove

To run the demo with foxglove, use

ros2 launch postgis_ros_bridge_demo gravel_quarry.launch.py foxglove:=true rviz:=false

in foxglove:

  1. Connect to ws://localhost:8765
  2. 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
  3. Set ROS_PACKAGE_PATH under Profile->Settings to /workspaces/postgis_ros_bridge_demo_workspace/install/share (needed to find meshes)

The result should look as follows:

Setup - Detailed Step-by-Step

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!

template_vscode

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

template_vscode_bottom

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"

template_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

Optional usage without GUI (e.g., rviz2)

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.

Trouble-Shooting

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.

Credits

Funding

[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.

www.ffg.at

Projekt: openSCHEMA

About

Demo VSCode workspace to showcase the PostGIS to ROS bridge.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages