I have a simulation of a robot arm that moves objects from one location to another. There are 4 crates distributed around the robot arm and each crate has 3 compartments in which an object can be placed. At initialisation, the user places an object in a crate by first selecting which create (N, S, E or W) and then selecting which compartment the object will go in (1, 2 or 3).
I wish to test the initialisation code to ensure that the object position is consistent with the user configuration. What is the best way to go about this without almost totally repeating the initialisation logic? i.e.
user_crate = 'N'
user_compartment = 1
obj_pos = create_pos[user_crate] + compartment_offset[user_compartment]
Aucun commentaire:
Enregistrer un commentaire