Skip to content

Commit

Permalink
ENH: x_position to x_offset
Browse files Browse the repository at this point in the history
  • Loading branch information
MateusStano committed May 16, 2024
1 parent a20d31d commit ce1d179
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions rocketpy/rocket/rocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,7 @@ def add_parachute(
self.parachutes.append(parachute)
return self.parachutes[-1]

def add_sensor(self, sensor, position, x_position=0, y_position=0):
def add_sensor(self, sensor, position, x_offset=0, y_offset=0):
"""Adds a sensor to the rocket.
Parameters
Expand All @@ -1180,18 +1180,20 @@ def add_sensor(self, sensor, position, x_position=0, y_position=0):
position : int, float, tuple
Position, in meters, of the sensor's coordinate system origin
relative to the user defined rocket coordinate system.
x_position : int, float, optional
Distance in meters by which the sensor is to be translated in the x
direction relative to geometrical center line. Default is 0.
y_position : int, float, optional
Distance in meters by which the sensor is to be translated in the y
direction relative to geometrical center line. Default is 0.
x_offset : int, float, optional
Distance in meters by which the sensor is to be translated in the
rocket's x direction relative to geometrical center line.
Default is 0.
y_offset : int, float, optional
Distance in meters by which the sensor is to be translated in the
rocket's y direction relative to geometrical center line.
Default is 0.
Returns
-------
None
"""
self.sensors.add(sensor, Vector([x_position, y_position, position]))
self.sensors.add(sensor, Vector([x_offset, y_offset, position]))
try:
sensor._attached_rockets[self] += 1
except KeyError:
Expand Down

0 comments on commit ce1d179

Please sign in to comment.