UBCSailbot / sailbot_workspace

UBC Sailbot's monorepo
https://ubcsailbot.github.io/sailbot_workspace/main/
Apache License 2.0
5 stars 2 forks source link

Publish physics engine data #400

Open eomielan opened 5 months ago

eomielan commented 5 months ago

Purpose

The purpose of this issue is to update the physics engine node to publish real data obtained from the physics engine to the ROS network.

Description

Update __publish_kinematics() to publish real data instead of hardcoded values to the ROS network. You can assume that the boat state (self.__boat_state) has been updated elsewhere. Please update the following parts of the ROS message to publish real data:

Ressources

alberto-escobar commented 1 month ago

implemented the following in __publish_kinematics

        # had to make elements into float or else I would get issues
        msg.global_pose.position.x = float(self.__boat_state.global_position[0])
        msg.global_pose.position.y = float(self.__boat_state.global_position[1])
        msg.global_pose.position.z = float(self.__boat_state.global_position[2])
        msg.global_pose.orientation.x = float(self.__boat_state.angular_position[0])
        msg.global_pose.orientation.y = float(self.__boat_state.angular_position[1])
        msg.global_pose.orientation.z = float(self.__boat_state.angular_position[2])
        msg.global_pose.orientation.w = 1.0

        msg.wind_velocity.x = self.__wind_generator.velocity[0]
        msg.wind_velocity.y = self.__wind_generator.velocity[1]
        msg.wind_velocity.z = self.__wind_generator.velocity[2]

        msg.current_velocity.x = self.__current_generator.velocity[0]
        msg.current_velocity.y = self.__current_generator.velocity[1]
        msg.current_velocity.z = self.__current_generator.velocity[2]