Skip to main content

Python package for interfacing with robot data

Project description

robotdatapy

Welcome to robotdatapy! At its core, robotdatapy is a package designed to make accessing and manipulating robot/geometric data easy in Python.

annotated_point_cloud

Install

robotdatapy is available via PyPi! To install:

pip install robotdatapy

Or to install the most recent version:

git clone git@github.com:mbpeterson70/robotdatapy.git
cd robotdatapy
pip install .

Introduction Tutorial

The best way to get familiar with robotdatapy is through the introductory tutorial, accessible here.

Data Interfaces

The primary use of this package is for interfacing with robot data. When developing offline robot applications, it can be difficult to deal with all of the different ways that data can be saved in (ROS bags, csv files, individual images, etc.). The goal of this package is to provide classes for loading data from a variety of sources, enabling a downstream task to use these data interfaces without needing to account for where that data is coming from.

Additionally, when dealing with offline data, a user may want to get a camera image at a certain time as well as a robot pose estimate at that same time. However, pose estimates are often discrete and may not be synced with the camera image. This package provides a way of dealing with time synchronization between data via interpolation or finding the nearest datapoint to a requested timestamp.

This README briefly describes three robot data classes: PoseData, ImgData, PointCloudData, and ArrayData. See the examples folder for example Python notebooks of interacting with different robot data.

PoseData

PoseData can load pose information from ROS1/2 bags, csv files, KITTI, or directly from a set of times and poses. Interpolation between poses is enabled by default, making it easy to get positions and orientations of a robot body at any time. Additionally, a transformation can be specified to be pre-multiplied or post-multiplied (via the T_premultiply or T_postmultiply keyword argument) changing the reference frame given by the PoseData object.

To quickly plot the trajectory of a robot for example, you can run the following:

import robotdatapy as rdp

bag_path = # path to bag
topic = # Odometry or Pose msg
pose_data = rdp.data.PoseData.from_bag(bag_path, topic=topic, interp=True)

pose_data.plot2d(dt=1.0, trajectory=True, pose=False)     # plots only position every second
pose_data.plot2d(dt=5.0, trajectory=False, pose=True)     # plots coordinate frames of the poses every 5 seconds

trajectory_plot

ImgData

ImgData can be loaded from ROS1/2 bags, a zipped file of images, a numpy npz files of times and images, or directly from a list of times and cv images. Depth images are supported as well.

Here's an example of loading and viewing an image from a ROS bag:

import robotdatapy as rdp

bag_path = # add ROS 1/2 bag path
topic = # camera image topic

img_data = rdp.data.ImgData.from_bag(
    bag_path,
    topic=topic
    compressed=True # tells the loader that the images are ROS CompressedImage messages
)

img_data.show(img_data.t0) # shows the first image

PointCloudData

PointCloudData can be loaded from ROS1/2 bags. Tools exist in robotdatapy to make transforming points or projecting points onto a camera image easy.

import robotdatapy as rdp

bag_path = # ROS 1/2 bag path
topic = # ROS point cloud topic

ptcld_data = rdp.data.PointCloudData.from_bag(
    bag_path,
    topic=topic,
)

ArrayData

This class can be used for storing generic data. For example, discrete samples of position, velocity, and acceleration. Linear interpolation can be turned on to enable accessing this data at any time.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

robotdatapy-1.1.4.tar.gz (31.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

robotdatapy-1.1.4-py3-none-any.whl (37.0 kB view details)

Uploaded Python 3

File details

Details for the file robotdatapy-1.1.4.tar.gz.

File metadata

  • Download URL: robotdatapy-1.1.4.tar.gz
  • Upload date:
  • Size: 31.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for robotdatapy-1.1.4.tar.gz
Algorithm Hash digest
SHA256 58479542b78165f014a54622262a4b67b866084192258963b7db6a2eda227ac3
MD5 10f4ce5fff3b431ae019afb20223a2ca
BLAKE2b-256 03ce42e3843498a8a11b1bc0a55f846b93fd9674075158eb38102d4b4444d5ed

See more details on using hashes here.

File details

Details for the file robotdatapy-1.1.4-py3-none-any.whl.

File metadata

  • Download URL: robotdatapy-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 37.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for robotdatapy-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b694ffdaf598c7cd73d6162e9e47b7a542fdcc8a6cfbf8ce208c36c4f98e711e
MD5 515e50da2f5e17c0bcc6cae2dc71f2ce
BLAKE2b-256 83ec3eba120adf3ad7a126b085b9ec30967722f9f84a8ae46b8fd8cd0286dec3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page