@@ -20,7 +20,7 @@ void fillZeros(gpudrive::MapObservation *begin,
2020 gpudrive::MapObservation *beyond) {
2121 while (begin < beyond) {
2222 *begin++ =
23- gpudrive::MapObservation{.position = {0 , 0 },
23+ gpudrive::MapObservation{.position = {0 , 0 , 0 },
2424 .scale = madrona::math::Diag3x3{0 , 0 , 0 },
2525 .heading = 0 .f ,
2626 .type = (float )gpudrive::EntityType::None};
@@ -30,16 +30,17 @@ void fillZeros(gpudrive::MapObservation *begin,
3030gpudrive::MapObservation
3131relativeObservation (const gpudrive::MapObservation &absoluteObservation,
3232 const madrona::base::Rotation &referenceRotation,
33- const madrona::math::Vector2 &referencePosition) {
33+ const madrona::math::Vector3 &referencePosition) {
3434 auto relativePosition =
35- madrona::math::Vector2{.x = absoluteObservation.position .x ,
36- .y = absoluteObservation.position .y } -
35+ madrona::math::Vector3{.x = absoluteObservation.position .x ,
36+ .y = absoluteObservation.position .y ,
37+ .z = absoluteObservation.position .z } -
3738 referencePosition;
3839
3940 return gpudrive::MapObservation{
4041 .position = referenceRotation.inv ()
41- .rotateVec ({relativePosition.x , relativePosition.y , 0 })
42- .xy (),
42+ .rotateVec ({relativePosition.x , relativePosition.y , relativePosition. z })
43+ .xyz (),
4344 .scale = absoluteObservation.scale ,
4445 .heading = gpudrive::utils::quatToYaw (referenceRotation.inv () * madrona::math::Quat::angleAxis (absoluteObservation.heading ,madrona::math::up)),
4546 .type = absoluteObservation.type };
@@ -50,7 +51,7 @@ bool isObservationsValid(gpudrive::Engine &ctx,
5051 gpudrive::MapObservation *observations,
5152 madrona::CountT K,
5253 const madrona::base::Rotation &referenceRotation,
53- const madrona::math::Vector2 &referencePosition) {
54+ const madrona::math::Vector3 &referencePosition) {
5455#ifdef MADRONA_GPU_MODE
5556 return true ;
5657#else
@@ -102,7 +103,7 @@ namespace gpudrive {
102103
103104template <madrona::CountT K>
104105void selectKNearestRoadEntities (Engine &ctx, const Rotation &referenceRotation,
105- const madrona::math::Vector2 &referencePosition,
106+ const madrona::math::Vector3 &referencePosition,
106107 gpudrive::MapObservation *heap) {
107108 const Entity *roads = ctx.data ().roads ;
108109 const auto roadCount = ctx.data ().numRoads ;
0 commit comments