Skip to content

mrob::CreatePoints class fix seed to reproduce results #54

@nosmokingsurfer

Description

@nosmokingsurfer

Add optional seed argument to CreatePoints::CreatePoints() constructor to fix randomness and gain reproducability in python scripts:

synthetic = mrob.registration.CreatePoints(N_points,N_planes,N_poses, 0.01, 0.0, T0) 

# now here every run result will be different
GTtraj = synthetic.get_trajectory()
target = np.array(synthetic.get_point_cloud(0)) 

May be can add overload for CreatePoints in C++ and add optional argument in python bindings:

#set seeds here if needed
torch.manual_seed(777)
np.random.seed(777)
...
synthetic = mrob.registration.CreatePoints(N_points,N_planes,N_poses, 0.01, 0.0, T0, seed = 777) 

# now results are the same every run
GTtraj = synthetic.get_trajectory()
target = np.array(synthetic.get_point_cloud(0))

Or do this in more global manner for all mrob modules in a single line:

mrob.seed(777)
...
synthetic = mrob.registration.CreatePoints(N_points,N_planes,N_poses, 0.01, 0.0, T0)
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions