Skip to content

Commit

Permalink
Merge pull request #1 from tfoldi/cast_to_float
Browse files Browse the repository at this point in the history
fix: cast int arrays to float
  • Loading branch information
abizovnuralem authored Feb 26, 2024
2 parents 254e8db + 1c5dca5 commit ce9afbf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions go2_robot_sdk/go2_robot_sdk/webrtc_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ async def connect(self):
"sdp": offer,
"id": "STA_localNetwork",
"type": "offer",
"token": "",
"token": os.getenv("GO2_TOKEN") or "",
}
async with session.post(url, json=data, headers=headers) as resp:
if resp.status == 200:
Expand Down Expand Up @@ -688,16 +688,16 @@ def publish_robot_state(self):
go2_state.position = self.robot_sport_state["data"]["position"]
go2_state.body_height = self.robot_sport_state["data"]["body_height"]
go2_state.velocity = self.robot_sport_state["data"]["velocity"]
go2_state.range_obstacle = self.robot_sport_state["data"]["range_obstacle"]
go2_state.range_obstacle = list(map(float, self.robot_sport_state["data"]["range_obstacle"]))
go2_state.foot_force = self.robot_sport_state["data"]["foot_force"]
go2_state.foot_position_body = self.robot_sport_state["data"]["foot_position_body"]
go2_state.foot_speed_body = self.robot_sport_state["data"]["foot_speed_body"]
go2_state.foot_speed_body = list(map(float, self.robot_sport_state["data"]["foot_speed_body"]))
self.go2_state_pub.publish(go2_state)

imu = IMU()
imu.quaternion = self.robot_sport_state["data"]["imu_state"]["quaternion"]
imu.accelerometer = self.robot_sport_state["data"]["imu_state"]["accelerometer"]
imu.gyroscope = self.robot_sport_state["data"]["imu_state"]["gyroscope"]
imu.accelerometer = list(map(float,self.robot_sport_state["data"]["imu_state"]["accelerometer"]))
imu.gyroscope = list(map(float,self.robot_sport_state["data"]["imu_state"]["gyroscope"]))
imu.rpy = self.robot_sport_state["data"]["imu_state"]["rpy"]
imu.temperature = self.robot_sport_state["data"]["imu_state"]["temperature"]
self.imu_pub.publish(imu)
Expand Down Expand Up @@ -760,4 +760,4 @@ def main():


if __name__ == '__main__':
main()
main()

0 comments on commit ce9afbf

Please sign in to comment.