初始化项目,包含fast_lio_ws和unitree_sdk2
This commit is contained in:
56
unitree_sdk2/include/unitree/dds_wrapper/robots/r1/defines.h
Normal file
56
unitree_sdk2/include/unitree/dds_wrapper/robots/r1/defines.h
Normal file
@@ -0,0 +1,56 @@
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
|
||||
namespace unitree
|
||||
{
|
||||
namespace robot
|
||||
{
|
||||
namespace r1
|
||||
{
|
||||
|
||||
enum class JointIndex
|
||||
{
|
||||
// left leg
|
||||
LeftHipPitch = 0,
|
||||
LeftHipRoll,
|
||||
LeftHipYaw,
|
||||
LeftKnee,
|
||||
LeftAnklePitch,
|
||||
LeftAnkleRoll,
|
||||
|
||||
// right leg
|
||||
RightHipPitch,
|
||||
RightHipRoll,
|
||||
RightHipYaw,
|
||||
RightKnee,
|
||||
RightAnklePitch,
|
||||
RightAnkleRoll,
|
||||
|
||||
WaistRoll,
|
||||
WaistYaw,
|
||||
// no pitch
|
||||
|
||||
// left arm
|
||||
LeftShoulderPitch = 15,
|
||||
LeftShoulderRoll,
|
||||
LeftShoulderYaw,
|
||||
LeftElbow,
|
||||
LeftWristRoll,
|
||||
|
||||
// right arm
|
||||
RightShoulderPitch = 22,
|
||||
RightShoulderRoll,
|
||||
RightShoulderYaw,
|
||||
RightElbow,
|
||||
RightWristRoll,
|
||||
|
||||
// head
|
||||
HeadPitch = 29,
|
||||
HeadYaw,
|
||||
};
|
||||
|
||||
|
||||
} // namespace r1
|
||||
} // namespace robot
|
||||
} // namespace unitree
|
||||
15
unitree_sdk2/include/unitree/dds_wrapper/robots/r1/r1.h
Normal file
15
unitree_sdk2/include/unitree/dds_wrapper/robots/r1/r1.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include "unitree/dds_wrapper/robots/r1/r1_pub.h"
|
||||
|
||||
namespace unitree
|
||||
{
|
||||
namespace robot
|
||||
{
|
||||
namespace r1
|
||||
{
|
||||
|
||||
|
||||
} // namespace r1
|
||||
} // namespace robot
|
||||
} // namespace unitree
|
||||
48
unitree_sdk2/include/unitree/dds_wrapper/robots/r1/r1_pub.h
Normal file
48
unitree_sdk2/include/unitree/dds_wrapper/robots/r1/r1_pub.h
Normal file
@@ -0,0 +1,48 @@
|
||||
#pragma once
|
||||
|
||||
#include <eigen3/Eigen/Dense>
|
||||
#include <unitree/dds_wrapper/common/Publisher.h>
|
||||
#include <unitree/idl/hg/LowCmd_.hpp>
|
||||
#include "defines.h"
|
||||
|
||||
namespace unitree
|
||||
{
|
||||
namespace robot
|
||||
{
|
||||
namespace r1
|
||||
{
|
||||
namespace publisher
|
||||
{
|
||||
|
||||
class ArmSdk : public RealTimePublisher<unitree_hg::msg::dds_::LowCmd_>
|
||||
{
|
||||
public:
|
||||
ArmSdk(std::string topic = "rt/arm_sdk") : RealTimePublisher<MsgType>(topic)
|
||||
{
|
||||
}
|
||||
|
||||
void weight(float coe) { msg_.mode_pr() = std::clamp(int(coe * 100.0f), 0, 100); }
|
||||
|
||||
float weight() const { return float(msg_.mode_pr()) / 100.0; }
|
||||
|
||||
static constexpr std::array<JointIndex, 13> JOINTS = {
|
||||
JointIndex::LeftShoulderPitch,
|
||||
JointIndex::LeftShoulderRoll,
|
||||
JointIndex::LeftShoulderYaw,
|
||||
JointIndex::LeftElbow,
|
||||
JointIndex::LeftWristRoll,
|
||||
JointIndex::RightShoulderPitch,
|
||||
JointIndex::RightShoulderRoll,
|
||||
JointIndex::RightShoulderYaw,
|
||||
JointIndex::RightElbow,
|
||||
JointIndex::RightWristRoll,
|
||||
JointIndex::WaistYaw,
|
||||
JointIndex::HeadPitch,
|
||||
JointIndex::HeadYaw,
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user