Skip to content

Commit

Permalink
Update ff_sim/ff_sim/controller_metrics.py
Browse files Browse the repository at this point in the history
Change incorrect usage of self.get_clock().now() function

Co-authored-by: Alvin Sun <[email protected]>
  • Loading branch information
AndrewHWang1605 and alvinsunyixiao authored Apr 30, 2024
1 parent 1b1fd74 commit 3c20d70
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ff_sim/ff_sim/controller_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,8 @@ def process_new_wheel_cmd(self, msg: WheelVelCommand) -> None:

def process_new_binary_thrust_cmd(self, msg: ThrusterCommand) -> None:
"""Process binary thrusters"""
now = self.get_clock().now().to_msg()
dtsec = now.sec - self.curr_time.sec
dtnsec = now.nanosec - self.curr_time.nanosec
dt = dtsec + dtnsec / 1e9
now = self.get_clock().now()
dt = (now - self.curr_time).nanoseconds / 1e9

# Perform Euler integration for how long each thruster was on
thrusters = np.array(msg.switches, dtype=float)
Expand Down

0 comments on commit 3c20d70

Please sign in to comment.