-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDog_connection_test.m
61 lines (49 loc) · 1.24 KB
/
Dog_connection_test.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
%% Clean
clc;
close all;
%% Robot Dog Network Parameters
% this IP is the vm ip
Robot_Dog_IP = '192.168.123.161';
Robot_Dog_Port = 1145;
%% parameters
run_time = 5;
x_speed = 1.5; %(0.11,1]
z_speed = 0;
%% Robot Dog Command Initialized
Control_Command = zeros(1,11,'single');
%velocity walking
% Robot dog command
% Control_Command()
%
% +(11) +(9) -(11)
% |
% +(10) dog -(10)
% |
% -(9)
%
% Motive coordiate frame
% wall wall wall wall wall
% ^ z
% |
% |
% x <----O y(pointing up)
%
%
% wall computer wall
%% Instantiate client object to run Motive API commands
% Check list:
% 1.Broadcast Frame Date
% 2.Network Interface: Local Loopback
% https://optitrack.com/software/natnet-sdk/
% Create Motive client object
dllPath = fullfile('d:','StDroneControl','NatNetSDK','lib','x64','NatNetML.dll');
assemblyInfo = NET.addAssembly(dllPath); % Add API function calls
theClient = NatNetML.NatNetClientML(0);
% Create connection to localhost, data is now being streamed through client object
HostIP = '127.0.0.1';
theClient.Initialize(HostIP, HostIP);
%%
Dog_ID = 1; % Rigid body ID of the drone from Motive
% dance 1
Control_Command(1)=12;
Robot_Dog(Robot_Dog_IP,Robot_Dog_Port,Control_Command);