Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
isae-group-drone
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RIBEIRO-LUSTOSA Leandro
isae-group-drone
Commits
91eeeb52
Commit
91eeeb52
authored
2 years ago
by
RIBEIRO-LUSTOSA Leandro
Browse files
Options
Downloads
Patches
Plain Diff
cleaned UDP code a bit
parent
f8180b05
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tello-vision.cpp
+5
-20
5 additions, 20 deletions
tello-vision.cpp
with
5 additions
and
20 deletions
tello-vision.cpp
+
5
−
20
View file @
91eeeb52
...
...
@@ -9,8 +9,8 @@
#include
<arpa/inet.h>
#include
<netinet/in.h>
#define PORT 11112
#define MAXLINE 1024
#define
MATLAB_
PORT 11112
#define MAXLINE
1024
using
namespace
cv
;
...
...
@@ -18,8 +18,8 @@ int main(int argc, char** argv) {
int
sockfd
;
char
buffer
[
MAXLINE
];
char
hello
[]
=
"x:1
2
;y:34;"
;
struct
sockaddr_in
servaddr
,
cliaddr
;
char
hello
[]
=
"x:1
5
;y:34;"
;
struct
sockaddr_in
cliaddr
;
// Creating socket file descriptor
if
(
(
sockfd
=
socket
(
AF_INET
,
SOCK_DGRAM
,
0
))
<
0
)
{
...
...
@@ -27,27 +27,12 @@ int main(int argc, char** argv) {
exit
(
EXIT_FAILURE
);
}
memset
(
&
servaddr
,
0
,
sizeof
(
servaddr
));
memset
(
&
cliaddr
,
0
,
sizeof
(
cliaddr
));
// Filling server information
servaddr
.
sin_family
=
AF_INET
;
// IPv4
servaddr
.
sin_addr
.
s_addr
=
INADDR_ANY
;
servaddr
.
sin_port
=
htons
(
PORT
+
1
);
// Filling cliaddr information
cliaddr
.
sin_family
=
AF_INET
;
// IPv4
cliaddr
.
sin_addr
.
s_addr
=
INADDR_ANY
;
cliaddr
.
sin_port
=
htons
(
PORT
);
// Bind the socket with the server address
if
(
bind
(
sockfd
,
(
const
struct
sockaddr
*
)
&
servaddr
,
sizeof
(
servaddr
))
<
0
)
{
perror
(
"bind failed"
);
exit
(
EXIT_FAILURE
);
}
int
len
,
n
;
cliaddr
.
sin_port
=
htons
(
MATLAB_PORT
);
Mat
frame
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment