Main Content


Datastore for training and validating deep-learning-based CHOMP optimizer

Since R2024a


    The dlCHOMPDatastore creates a custom datastore for training and validating a dlCHOMP object. Use an dlCHOMPDatastore object to manage a collection of data sample JSON files. You can create an dlCHOMPDatastore object, specify its properties, and then import and process the data using the object functions of dlCHOMPDatastore.



    DS = dlCHOMPDatastore(folderpath,sampleidxs) creates a DLCHOMP datastore that stores data sample JSON files with the specified indices in the specified folder. The names of the JSON files must match the format name_index.json, where index is a positive integer specifying the index of the data sample.

    [trainingDS,validationDS] = generateSamples(___) generates training and validation data samples as dlCHOMPDatastore objects for training with the trainDLCHOMP function. For more information about how to generate samples, see Train Deep-Learning-Based CHOMP Optimizer for Motion Planning.

    The dlCHOMPDatastore object requires the Deep Learning Toolbox™.

    Input Arguments

    expand all

    Folder path to the stored data sample JSON files, specified as a string scalar or character array.

    JSON data files in the specified folder must have these fields:

    • SphericalObstacles.centers — Center positions of spherical obstacles, specified as an N-by-3 matrix, where each row is an xyz-position of a spherical obstacle. N is the total number of spherical obstacles.

    • SphericalObstacles.radius — Radii of spherical obstacles, specified as an N-element row vector. N is the total number of spherical obstacles.

    • Trajectory — Optimized waypoints trajectory returned by optimize, specified as a W-by-M matrix. W is the number of waypoints and M is the number of movable joints of the rigid body tree. The trajectory must include the start and goal waypoints which should correspond to first and last waypoints in the matrix respectively.

    • Encoding — Obstacle encoding, specified as an E-element column vector. E is the size of the basis point set.

    Data Types: string | char

    Indices of JSON files to include in datastore, specified as an N-element vector of positive integers.


    expand all

    This property is read-only.

    File set for managing the data sample JSON files, stored as a DsFileSet object.

    This property stores the full file paths to all the data sample JSON files in the dlCHOMPDatastore.

    This property is read-only.

    Alternate file system root paths, specified as a string vector or a cell array. See AlternateFileSystemRoots from for more information.

    Object Functions

    readRead data from datastore
    readallRead all data in datastore
    hasdata Determine if data is available to read
    resetReset datastore to initial state
    previewPreview subset of data in datastore
    progress Determine how much data has been read
    combineCombine data from multiple datastores
    transformTransform datastore
    isPartitionableDetermine whether datastore is partitionable
    isSubsettableDetermine whether datastore is subsettable
    isShuffleableDetermine whether datastore is shuffleable

    Version History

    Introduced in R2024a