plcopen 0.22.0
载入中...
搜索中...
未找到
dynamics_fixture.h
浏览该文件的文档.
1#pragma once
2
3// Shared H3 acceptance/benchmark fixture. Parameters are synthetic and kept
4// in-repository; they do not represent a vendor robot.
5
7
9{
10
12{
14 spec.joint_count = 8;
15 for (std::size_t joint = 0; joint < spec.joint_count; ++joint)
16 {
17 dyn::RevoluteBody body{};
18 if (joint != 0)
19 {
20 const double index = static_cast<double>(joint);
22 geom::make_rpy_transform(0.12 + 0.01 * index, 0.01 * (index - 3.0),
23 0.015 * (index - 2.0), 0.02 * index,
24 -0.015 * index, 0.01 * index);
25 }
26 switch (joint % 3)
27 {
28 case 0:
29 body.joint_axis = {1.0, 0.0, 0.0};
30 break;
31 case 1:
32 body.joint_axis = {0.0, 1.0, 0.0};
33 break;
34 default:
35 body.joint_axis = {0.0, 0.0, 1.0};
36 break;
37 }
38 const double index = static_cast<double>(joint);
39 body.mass = 1.0 + 0.15 * index;
40 body.center_of_mass = {0.04 + 0.002 * index, -0.01 + 0.001 * index,
41 0.015 - 0.0005 * index};
42 body.inertia_com[0][0] = 0.020 + 0.0010 * index;
43 body.inertia_com[1][1] = 0.024 + 0.0012 * index;
44 body.inertia_com[2][2] = 0.028 + 0.0014 * index;
45 body.inertia_com[0][1] = body.inertia_com[1][0] = 0.0004;
46 body.inertia_com[0][2] = body.inertia_com[2][0] = -0.0003;
47 body.inertia_com[1][2] = body.inertia_com[2][1] = 0.0002;
48 spec.bodies[joint] = body;
49 }
50 return spec;
51}
52
53} // namespace plcopen::core::test_support
RigidTransform make_rpy_transform(double x, double y, double z, double roll, double pitch, double yaw)
定义 frame.h:71
dyn::FixedBaseChainSpec eight_joint_dynamics_spec()
std::array< RevoluteBody, FixedBaseChainMaxJoints > bodies