Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kwarg for add_joint entries. #81

Open
Ipuch opened this issue Jul 29, 2023 · 0 comments
Open

kwarg for add_joint entries. #81

Ipuch opened this issue Jul 29, 2023 · 0 comments
Labels
good first issue Good for newcomers

Comments

@Ipuch
Copy link
Owner

Ipuch commented Jul 29, 2023

following #78

We should consider a kwarg to pass any entry to the joint:

def add_joint(
self,
name: str,
joint_type: JointType,
parent: str,
child: str,
parent_axis: NaturalAxis | tuple[NaturalAxis] | list[NaturalAxis] = None,
child_axis: NaturalAxis | tuple[NaturalAxis] | list[NaturalAxis] = None,
parent_point: str = None,
child_point: str = None,
length: float = None,
theta: float | tuple[float] | list[float] = None,
):
"""
This method adds a joint to the model
Parameters
----------
name: str
The name of the joint
joint_type : JointType
The joint to add
parent : str
The name of the parent segment
child : str
The name of the child segment
parent_axis : NaturalAxis | tuple[NaturalAxis] | list[NaturalAxis]
The axis of the parent segment, zero, one or two element but not more.
child_axis : NaturalAxis | tuple[NaturalAxis] | list[NaturalAxis]
The axis of the child segment, zero, one or two element but not more.
parent_point : str
The name of the parent point
child_point : str
The name of the child point
length : float
The length for the constant length joint constraint
theta : float | tuple[float] | list[float]
The angle of axis constraints, zero, one or two element but not more.
Returns
-------
None
"""
if name is None:
name = f"{parent}_{child}"
self.joints[name] = dict(
name=name,
joint_type=joint_type,
parent=parent,
child=child,
parent_axis=parent_axis,
child_axis=child_axis,
theta=theta,
parent_point=parent_point,
child_point=child_point,
length=length,
)

@Ipuch Ipuch added the good first issue Good for newcomers label Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant