Skip to main content

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.

Command Line Interface

robotdatapy offers a growing number of tools directly from the command line. For example, rdp-plot-trajectory enables easy trajectory plotting.

To get these to work with tab complete, for bash run activate-global-python-argcomplete --user. If using zsh, add the following to your ~/.zshrc:

autoload -Uz compinit && compinit
autoload -Uz bashcompinit && bashcompinit                      
eval "$(register-python-argcomplete rdp-plot-trajectory)"

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.

Metadata

Release files for robotdatapy 1.1.17

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for robotdatapy 1.1.17
File Size Uploaded
robotdatapy-1.1.17.tar.gz 46.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for robotdatapy 1.1.17
File Interpreter ABI Platform
robotdatapy-1.1.17-py3-none-any.whl Python 3 none any Details

Total release size: 101.4 kB

Release files / robotdatapy-1.1.17.tar.gz

Download URL robotdatapy-1.1.17.tar.gz
Size 46.3 kB
Tags Source
SHA-256 checksum
How to use checksums
48a1c4699424ba660507b11b7403e16eac426c56b5e9c420bba5c5c8c88b8cbe
BLAKE2b-256 checksum
How to use checksums
7b1e6e37e39af0d9de98b4591d826b7c4747abce35651182e2c8e161aafd250f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / robotdatapy-1.1.17-py3-none-any.whl

Download URL robotdatapy-1.1.17-py3-none-any.whl
Size 55.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0437a04327ade92b9b70b0f1703362af14101d9347ef932aa195b84885f8f98a
BLAKE2b-256 checksum
How to use checksums
2c03095da379bce0e7b2cf46298a32f47f8f92729aff5043e97f1b460e772f51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

1.1.17 This release

2 release files

1.1.14

2 release files

1.1.11

2 release files

1.1.8

2 release files

1.1.4

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page