MCPcopy Create free account
hub / github.com/darglein/ADOP / PoseModuleImpl

Method PoseModuleImpl

src/lib/data/NeuralStructure.cpp:5–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include "rendering/PointRenderer.h"
4
5PoseModuleImpl::PoseModuleImpl(std::shared_ptr<SceneData> scene)
6{
7 SAIGA_ASSERT(!scene->frames.empty());
8
9 tangent_poses = torch::zeros({(long)scene->frames.size(), 6L},
10 torch::TensorOptions().dtype(torch::kFloat64).device(torch::kCUDA))
11 .clone();
12 tangent_poses = tangent_poses.set_requires_grad(true);
13
14 std::vector<Sophus::SE3d> pose_data;
15 for (auto& f : scene->frames)
16 {
17 pose_data.push_back(f.pose.inverse());
18 }
19 static_assert(sizeof(Sophus::SE3d) == sizeof(double) * 8);
20
21 poses_se3 =
22 torch::from_blob(pose_data.data(), {(long)pose_data.size(), 8L}, torch::TensorOptions().dtype(torch::kFloat64))
23 .clone()
24 .cuda();
25
26 // The last element is just padding
27 poses_se3.slice(1,7,8).zero_();
28 register_parameter("tangent_poses", tangent_poses);
29 register_buffer("poses_se3", poses_se3);
30}
31
32PoseModuleImpl::PoseModuleImpl(Sophus::SE3d pose)
33{

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected