| 84 | } |
| 85 | |
| 86 | void Custom::Init() |
| 87 | { |
| 88 | InitLowCmd(); |
| 89 | /*create publisher*/ |
| 90 | lowcmd_publisher.reset(new ChannelPublisher<unitree_go::msg::dds_::LowCmd_>(TOPIC_LOWCMD)); |
| 91 | lowcmd_publisher->InitChannel(); |
| 92 | |
| 93 | /*create subscriber*/ |
| 94 | lowstate_subscriber.reset(new ChannelSubscriber<unitree_go::msg::dds_::LowState_>(TOPIC_LOWSTATE)); |
| 95 | lowstate_subscriber->InitChannel(std::bind(&Custom::LowStateMessageHandler, this, std::placeholders::_1), 1); |
| 96 | |
| 97 | /*loop publishing thread*/ |
| 98 | lowCmdWriteThreadPtr = CreateRecurrentThreadEx("writebasiccmd", UT_CPU_ID_NONE, int(dt * 1000000), &Custom::LowCmdWrite, this); |
| 99 | } |
| 100 | |
| 101 | void Custom::InitLowCmd() |
| 102 | { |
no test coverage detected