Download gpudrive-main/tests/EgocentricRoadObservationTests.cpp from lzhts1/FromSim2Real: direct link, hf CLI and curl.
- Browser
- Download file 773 Bytes
-
https://huggingface.co/datasets/lzhts1/FromSim2Real/resolve/main/gpudrive-main/tests/EgocentricRoadObservationTests.cpp
- Command line
-
hf download hf://datasets/lzhts1/FromSim2Real/gpudrive-main/tests/EgocentricRoadObservationTests.cpp
-
curl -L -o EgocentricRoadObservationTests.cpp https://huggingface.co/datasets/lzhts1/FromSim2Real/resolve/main/gpudrive-main/tests/EgocentricRoadObservationTests.cpp
773 Bytes
| using namespace madrona; | |
| using namespace madrona::base; | |
| using namespace madrona::math; | |
| using madrona_gpudrive::utils::ReferenceFrame; | |
| TEST(EgocentricRoadObservationTests, Relative) { | |
| ReferenceFrame rf{Vector2{.x = 3, .y = 0}, | |
| Quat::angleAxis(toRadians(90), madrona::math::up)}; | |
| auto mapObs = | |
| rf.observationOf(Vector3{.x = 3, .y = 3, .z = 0}, | |
| Quat::angleAxis(toRadians(270), madrona::math::up), | |
| Scale{{.d0 = 10, .d1 = 0.1, .d2 = 0.1}}, | |
| static_cast<madrona_gpudrive::EntityType>(0), 0); | |
| EXPECT_LT(mapObs.position.x - 3, 0.000001); | |
| EXPECT_LT(mapObs.position.y - 0, 0.000001); | |
| EXPECT_EQ(mapObs.heading, toRadians(180)); | |
| } | |