Skip to content

Commit

Permalink
fix high example
Browse files Browse the repository at this point in the history
  • Loading branch information
TrivasZhang committed Sep 14, 2021
1 parent 4fafb79 commit ca3148f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
11 changes: 0 additions & 11 deletions examples/example_dance.cpp
Expand Up @@ -13,12 +13,8 @@ using namespace UNITREE_LEGGED_SDK;
class Custom
{
public:
// Custom(uint8_t level): safe(LeggedType::A1), udp(level){
// Custom(uint8_t level): safe(LeggedType::A1), udp(8090, "192.168.123.11", 8082, sizeof(HighCmd), sizeof(HighState)){
Custom(uint8_t level): safe(LeggedType::A1), udp(8090, "192.168.123.161", 8082, sizeof(HighCmd), sizeof(HighState)){
udp.InitCmdData(cmd);
udp.SetDisconnectTime(dt, 1);
// udp.SetDisconnectTime(0, 0);
}
void UDPRecv();
void UDPSend();
Expand Down Expand Up @@ -48,9 +44,6 @@ void Custom::RobotControl()
motiontime += 2;
udp.GetRecv(state);
// printf("%d %f\n", motiontime, state.forwardSpeed);
// printf("%f %f \n", state.imu.quaternion[0], state.imu.quaternion[1]);
// printf("%f %f \n", state.imu.rpy[1], state.imu.rpy[2]);
// printf("%f %f %f %f %f\n", state.imu.rpy[1], state.imu.rpy[2], state.position[0], state.position[1], state.velocity[0]);

cmd.mode = 0; // 0:idle, default stand 1:forced stand 2:walk continuously
cmd.gaitType = 0;
Expand All @@ -65,7 +58,6 @@ void Custom::RobotControl()
cmd.yawSpeed = 0.0f;



if(motiontime > 0 && motiontime < 4000){
cmd.mode = 12;
printf("dance1 \n");
Expand Down Expand Up @@ -118,9 +110,6 @@ void Custom::RobotControl()
cmd.mode = 1;
}




udp.SetSend(cmd);
}

Expand Down
3 changes: 0 additions & 3 deletions examples/example_walk.cpp
Expand Up @@ -13,11 +13,8 @@ using namespace UNITREE_LEGGED_SDK;
class Custom
{
public:
// Custom(uint8_t level): safe(LeggedType::A1), udp(8090, "192.168.123.11", 8082, sizeof(HighCmd), sizeof(HighState)){
Custom(uint8_t level): safe(LeggedType::A1), udp(8090, "192.168.123.161", 8082, sizeof(HighCmd), sizeof(HighState)){
udp.InitCmdData(cmd);
udp.SetDisconnectTime(dt, 1);
// udp.SetDisconnectTime(0, 0);
}
void UDPRecv();
void UDPSend();
Expand Down

0 comments on commit ca3148f

Please sign in to comment.