Hello !
I thought I had made some progress , but looks like I'm in a dead-end now. I focus on motion rig with roll/pitch/yaw/heave/sway/surge like
@ashupp and used code from
@Bornhall and
@gt7coder for the packet structure, and of course based on
@Nenkai work. I generated CSV from the decoded packet and tried to make some graphs to understand and figure values I needed. But I'm lost now.
What puzzles me is that for exemple I see positive and negative values for all velocity axes whereas I have always moved forward so I expected at least one of the three values to be always positive.
I was also unable to recreate the track aspect as some of you do, by plotting X,Y on a graph. This makes me think I have an issue with my code.... but values seem to move nicely without jumps.
Do you guys have the same behavior with the raw data ? Any idea of what I have missed ?
Packet format I used is this one, and seems accurate as values are moving smoothly withtou errors.
class GTDataPacket:
def __init__(self, data):
## Format string that allows unpack to process the data bytestream:
gt_format = '<ifffffffffffffffccccfffffffffffihhiiihhhhhhBBBcffffffffffffffffffffffffffffffffffffi'
(self.magic, #int32
self.position_x, #single
self.position_y, #single
self.position_z, #single
self.velocity_x, #single
self.velocity_y, #single
self.velocity_z, #single
self.rotation_x, #single
self.rotation_y, #single
self.rotation_z, #single
self.northorientation, #single
self.angularvelocity_x, #single
self.angularvelocity_y, #single
self.angularvelocity_z, #single
self.body_height, #single
self.rpm, #single
self.iv1, #char
self.iv2, #char
self.iv3, #char
self.iv4, #char
self.fuel_level, #single
self.fuel_capacity, #single
self.speed, #single
self.boost, #single
self.oil_pressure_bar, #single
self.water_temperature, #single
self.oil_temperature, #single
self.tire_temp_FL, #single
self.tire_temp_FR, #single
self.tire_temp_RL, #single
self.tire_temp_RR, #single
self.pkt_id, #int32
self.current_lap, #int16
self.total_laps, #int16
self.best_lap_time, #int32
self.last_lap_time, #int32
self.day_progression_ms, #int32
self.pre_race_start_position, #int16
self.pre_race_num_cars, #int16
self.min_alert_rpm, #int16
self.max_alert_rpm, #int16
self.calculated_max_speed, #int16
self.flags, #int16
self.suggestedgear_gear, #byte
self.throttle, #byte
self.brake, #byte
self.padding_byte1, #byte
self.road_plane_x, #single
self.road_plane_y, #single
self.road_plane_z, #single
self.road_plane_dist, #single
self.tire_rps_FL, #single
self.tire_rps_FR, #single
self.tire_rps_RL, #single
self.tire_rps_RR, #single
self.tire_radius_FL, #single
self.tire_radius_FR, #single
self.tire_radius_RL, #single
self.tire_radius_RR, #single
self.susp_height_FL, #single
self.susp_height_FR, #single
self.susp_height_RL, #single
self.susp_height_RR, #single
self.unknown_single1, #byte
self.unknown_single2, #byte
self.unknown_single3, #byte
self.unknown_single4, #byte
self.unknown_single5, #byte
self.unknown_single6, #byte
self.unknown_single7, #byte
self.unknown_single8, #byte
self.clutch_pedal, #single
self.clutch_engagement, #single
self.rpm_clutch_gearbox, #single
self.transmission_top_speed, #single
self.gear_ratio1, #single
self.gear_ratio2, #single
self.gear_ratio3, #single
self.gear_ratio4, #single
self.gear_ratio5, #single
self.gear_ratio6, #single
self.gear_ratio7, #single
self.gear_ratio8, #single
self.car_code, #int32
) = unpack(gt_format, data)
The full code is here just in case:
https://github.com/vthinsel/GT7Proxy
View attachment 1182372
EDIT: I think I found the issue for the map: the Z axis is not what I used to play with other games such as PCars, but once axis are swapped, the map gets displayed fine. But I'm still puzzled about velocity axes behavior. Orientation looks almost fine (Y axis being used for yaw)