Skip to content

Comments

Add utilities to build primitive shapes#21

Merged
diegoferigo merged 2 commits intomainfrom
feature/primitives
Feb 20, 2023
Merged

Add utilities to build primitive shapes#21
diegoferigo merged 2 commits intomainfrom
feature/primitives

Conversation

@diegoferigo
Copy link
Contributor

@diegoferigo diegoferigo commented Feb 10, 2023

Initial support of creating elements of primitive shapes.

Quick example:

import numpy as np
import rod
from rod.builder import primitives

link_H_com = np.eye(4)
link_H_com[0:3, 3] = np.array([0, 0, 1.0])

model = (
    primitives.SphereBuilder(name="sphere", mass=1.0, radius=0.1)
    .build_model()
    .add_link()
    .add_inertial(pose=rod.Pose.from_transform(transform=link_H_com))
    .add_visual()
    .build()
)

sdf = rod.Sdf(version="1.9", model=model)

print(sdf.serialize(pretty=True))
sdf_string = sdf.serialize(pretty=True)

@diegoferigo diegoferigo self-assigned this Feb 10, 2023
@diegoferigo diegoferigo marked this pull request as ready for review February 20, 2023 08:33
@diegoferigo diegoferigo merged commit e45b5d9 into main Feb 20, 2023
@diegoferigo diegoferigo deleted the feature/primitives branch February 20, 2023 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants