scikit-robot icon indicating copy to clipboard operation
scikit-robot copied to clipboard

feat(primitives): add acceser to primitive properties

Open HiroIshida opened this issue 2 years ago • 0 comments

@iory I am considering to add accessor to the primitive properties (e.g. height, radius, urdf_path) as the commit.

I think there are two design choices: a) access by self.visual_meshdata["some_property"] and b) setting property in the constructor. Personally, I would choose (a) because it can avoid data duplication with self.visual_mesh.metadata. Which do you think is better ?

two example

example of (a)

@property
def radius(self) -> float:
    return self.visual_mesh.metadata["radius"]

example of (b)

self._radius = radius

and

@property
def radius(self) -> float:
    return self._radius

HiroIshida avatar Sep 28 '22 11:09 HiroIshida