Open eomielan opened 4 weeks ago
Created the following method in PhysicsEngineNode
class:
def __update_boat_state(self):
"""
Generates the next vectors for wind_generator and current_generator and updates the
boat_state with the new wind and current vectors along with the rudder_angle and
sail_trim_tab_angle.
"""
self.__boat_state(
self.__wind_generator.next(),
self.__current_generator.next(),
self.__rudder_angle,
self.__sail_trim_tab_angle,
)
then called __update_boat_state()
in __publish()
method before anything else was called:
# PUBLISHER CALLBACKS
def __publish(self):
self.__update_boat_state()
"""Synchronously publishes data to all publishers at once."""
...
did not implement tests as I am not sure how to go about testing this.
Purpose
This purpose of this issue is to update the physics engine node to combine the fluid generation class with the boat state class in a timer callback to calculate real values for the physics engine.
Description
Create a method in the
PhysicsEngineNode
class that will:Then call this method in
__publish()
before any of the other methods are called.Take a look at the FluidGenerator class for simulating wind and current velocities and the BoatState class for tracking and updating the boat's state based on the fluid vectors.
Ressources