21 lines
580 B
C++
21 lines
580 B
C++
#include <unitree/robot/channel/channel_publisher.hpp>
|
|
#include <unitree/common/time/time_tool.hpp>
|
|
#include "msg/ArmString_.hpp"
|
|
|
|
#define TOPIC "rt/arm_Command"
|
|
|
|
using namespace unitree::robot;
|
|
using namespace unitree::common;
|
|
|
|
int main()
|
|
{
|
|
ChannelFactory::Instance()->Init(0);
|
|
ChannelPublisher<unitree_arm::msg::dds_::ArmString_> publisher(TOPIC);
|
|
publisher.InitChannel();
|
|
|
|
unitree_arm::msg::dds_::ArmString_ msg{};
|
|
msg.data_() = "{\"seq\":4,\"address\":1,\"funcode\":5,\"data\":{\"mode\":0}}";
|
|
publisher.Write(msg);
|
|
|
|
return 0;
|
|
} |