• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lunarlab-gatech / robotdataprocess / 20868268100

09 Jan 2026 11:10PM UTC coverage: 70.585% (-4.1%) from 74.672%
20868268100

Pull #10

github

DanielChaseButterfield
Remove tutrle import
Pull Request #10: (v0.2) Prototype code for ROS2 Publishing, and new ImageDataOnDisk class

508 of 747 new or added lines in 12 files covered. (68.01%)

3 existing lines in 2 files now uncovered.

1411 of 1999 relevant lines covered (70.59%)

1.41 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.43
/src/robotdataprocess/data_types/Data.py
1
from __future__ import annotations
2✔
2

3
from ..conversion_utils import col_to_dec_arr
2✔
4
from decimal import Decimal
2✔
5
from enum import Enum
2✔
6
import numpy as np
2✔
7
from typeguard import typechecked
2✔
8
from typing import Any
2✔
9

10
class CoordinateFrame(Enum):
2✔
11
    """ 
12
    Enum for different coordinate frames used in robotics. 
13
    
14
    Attributes:
15
        FLU: X forward, Y left, Z up := RHS
16
        NED: X forward (north), Y right (east), Z down := RHS
17
        ENU: X right (east), Y forward (north), Z up := RHS
18
        NONE: No defined coordinate frame.
19
    """
20

21
    FLU = 0
2✔
22
    NED = 1
2✔
23
    ENU = 2
2✔
24
    NONE = 3
2✔
25

26
class ROSMsgLibType(Enum):
2✔
27
    """ 
28
    Enum for different ROS message library types.
29
     
30
    Attributes:
31
        ROSBAGS: Use ROS messages from the rosbags library (Pure Python library).
32
        RCLPY: Use ROS messages from the rclpy library (ROS2 Python client library).
33
        ROSPY: Use ROS messages from the rospy library (ROS1 Python client library).
34
    """
35

36
    ROSBAGS = 0
2✔
37
    RCLPY = 1
2✔
38
    ROSPY = 2
2✔
39

40
class Data:
2✔
41
    """
42
    Generic Data class that provides example methods that should be overwritten by children,
43
    and can run operations between different data types.
44
    """
45

46
    # Define data attributes for all Data classes
47
    frame_id: str
2✔
48
    timestamps: np.ndarray[Decimal]
2✔
49

50
    @typechecked
2✔
51
    def __init__(self, frame_id: str, timestamps: np.ndarray | list):
2✔
52
        
53
        # Copy initial values into attributes
54
        self.frame_id = frame_id
2✔
55
        self.timestamps = col_to_dec_arr(timestamps)
2✔
56

57
        # Check to ensure that all timestamps are sequential
58
        for i in range(len(self.timestamps) - 1):
2✔
59
            if self.timestamps[i] >= self.timestamps[i+1]:
2✔
60
                raise ValueError(f"Timestamps {self.timestamps[i]} and {self.timestamps[i+1]} do not come in sequential order!")
2✔
61
            
62
    def len(self):
2✔
63
        """ Returns the number of items in this data class """
64
        return len(self.timestamps)
2✔
65
    
66
    @staticmethod
2✔
67
    def get_ros_msg_type(self, libtype: ROSMsgLibType) -> Any:
2✔
68
        """ Will return the msgtype for the ROS message for this Data object. """
UNCOV
69
        raise NotImplementedError("This method needs to be overwritten by the child Data class!")
×
70
    
71
    def get_ros_msg(self, libtype: ROSMsgLibType, i: int):
2✔
72
        """ Will create and return a ROS message object. """
UNCOV
73
        raise NotImplementedError("This method needs to be overwritten by the child Data class!")
×
74
    
75
    def crop_data(self, start: Decimal, end: Decimal):
2✔
76
        """ Will crop the data so only values within [start, end] inclusive are kept. """
77
        raise NotImplementedError("This method needs to be overwritten by the child Data class!")
×
78

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc