Skip to content

Commit

Permalink
Rename steer attribute to front frame to fit the class name
Browse files Browse the repository at this point in the history
  • Loading branch information
tjstienstra committed Sep 4, 2023
1 parent a3a11b5 commit e25040b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/brim/brim/base_connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ class HandGripsBase(ConnectionBase):
"""Base class for the connection between the handlebar and the arms."""

required_models: tuple[ModelRequirement, ...] = (
ModelRequirement("steer", FrontFrameBase, "Front frame of the bicycle."),
ModelRequirement("front_frame", FrontFrameBase, "Front frame of the bicycle."),
ModelRequirement("left_arm", LeftArmBase, "Left arm of the rider.", hard=False),
ModelRequirement("right_arm", RightArmBase, "Right arm of the rider.",
hard=False),
)
steer: FrontFrameBase
front_frame: FrontFrameBase
left_arm: LeftArmBase
right_arm: RightArmBase

Expand Down
4 changes: 2 additions & 2 deletions src/brim/brim/bicycle_rider.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class BicycleRider(ModelBase):
"Connection between the cranks and the legs.", False),
ConnectionRequirement(
"hand_grips", HandGripsBase,
"Connection between the steer and the arms.", False),
"Connection between the front frame and the arms.", False),
)
bicycle: BicycleBase
rider: Rider
Expand All @@ -50,7 +50,7 @@ def _define_connections(self) -> None:
self.pedals.right_leg = self.rider.right_leg
self.pedals.cranks = self.bicycle.cranks
if self.hand_grips is not None:
self.hand_grips.steer = self.bicycle.front_frame
self.hand_grips.front_frame = self.bicycle.front_frame
self.hand_grips.left_arm = self.rider.left_arm
self.hand_grips.right_arm = self.rider.right_arm

Expand Down
12 changes: 6 additions & 6 deletions src/brim/brim/handgrips.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Module containing the steer connections."""
"""Module containing the hand grip connections."""
from __future__ import annotations

from typing import Any
Expand Down Expand Up @@ -37,7 +37,7 @@ def _define_constraints(self) -> None:

def attach_hand(hand_point, steer_point):
"""Attach the hand to the steer."""
for direction in self.steer.frame:
for direction in self.front_frame.frame:
constr = hand_point.pos_from(steer_point).dot(direction)
if not check_zero(constr):
if check_zero(constr.diff(dynamicsymbols._t)):
Expand All @@ -52,9 +52,9 @@ def attach_hand(hand_point, steer_point):
super()._define_constraints()
error_msg, constrs = [], []
if self.left_arm:
attach_hand(self.left_arm.hand_interpoint, self.steer.left_handgrip)
attach_hand(self.left_arm.hand_interpoint, self.front_frame.left_handgrip)
if self.right_arm:
attach_hand(self.right_arm.hand_interpoint, self.steer.right_handgrip)
attach_hand(self.right_arm.hand_interpoint, self.front_frame.right_handgrip)
if error_msg:
raise ValueError(error_msg)
self.system.add_holonomic_constraints(*constrs)
Expand Down Expand Up @@ -84,14 +84,14 @@ def _define_loads(self) -> None:
super()._define_loads()
if self.left_arm:
path_left = LinearPathway(
self.steer.left_handgrip, self.left_arm.hand_interpoint)
self.front_frame.left_handgrip, self.left_arm.hand_interpoint)
self.system.add_actuators(
LinearSpring(self.symbols["k"], path_left),
LinearDamper(self.symbols["c"], path_left)
)
if self.right_arm:
path_right = LinearPathway(
self.steer.right_handgrip, self.right_arm.hand_interpoint)
self.front_frame.right_handgrip, self.right_arm.hand_interpoint)
self.system.add_actuators(
LinearSpring(self.symbols["k"], path_right),
LinearDamper(self.symbols["c"], path_right)
Expand Down

0 comments on commit e25040b

Please sign in to comment.