Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MicroCART
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Distributed Autonomous Networked Control Lab
MicroCART
Commits
a4474dc7
Commit
a4474dc7
authored
8 years ago
by
burneykb
Browse files
Options
Downloads
Patches
Plain Diff
Expanded setpid to use all controller types
parent
4e7b209e
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
groundStation/src/backend/backend.c
+5
-1
5 additions, 1 deletion
groundStation/src/backend/backend.c
groundStation/src/backend/commands.c
+0
-1
0 additions, 1 deletion
groundStation/src/backend/commands.c
groundStation/src/cli/cli_setpid.c
+15
-4
15 additions, 4 deletions
groundStation/src/cli/cli_setpid.c
with
20 additions
and
6 deletions
groundStation/src/backend/backend.c
+
5
−
1
View file @
a4474dc7
...
@@ -671,12 +671,16 @@ static void client_recv(int fd) {
...
@@ -671,12 +671,16 @@ static void client_recv(int fd) {
write
(
fd
,
buffer
,
strlen
(
buffer
));
write
(
fd
,
buffer
,
strlen
(
buffer
));
}
}
}
}
}
else
{
}
else
{
if
(
clientAddPendResponses
(
fd
,
packet
)
==
-
1
)
{
if
(
clientAddPendResponses
(
fd
,
packet
)
==
-
1
)
{
warnx
(
"Ran out of room! Consider increasing CLIENT_MAX_PENDING_RESPONSES!
\n
"
);
warnx
(
"Ran out of room! Consider increasing CLIENT_MAX_PENDING_RESPONSES!
\n
"
);
}
else
{
}
else
{
int
datalen
=
(
packet
[
6
]
<<
8
)
|
(
packet
[
5
]);
int
datalen
=
(
packet
[
6
]
<<
8
)
|
(
packet
[
5
]);
printf
(
"sending %lf '"
,
getFloat
(
packet
,
7
));
for
(
int
i
=
0
;
i
<
datalen
+
8
;
++
i
)
{
printf
(
" 0x%x"
,
(
signed
)
packet
[
i
]);
}
printf
(
"'
\n
"
);
writeQuad
((
char
*
)
packet
,
datalen
+
8
);
writeQuad
((
char
*
)
packet
,
datalen
+
8
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
groundStation/src/backend/commands.c
+
0
−
1
View file @
a4474dc7
...
@@ -440,7 +440,6 @@ struct MessageType MessageTypes[MAX_TYPE] =
...
@@ -440,7 +440,6 @@ struct MessageType MessageTypes[MAX_TYPE] =
// Function pointer
// Function pointer
&
resprollangle
&
resprollangle
},
},
// resp yaw setpoint subtype
// resp yaw setpoint subtype
{
{
// ID
// ID
...
...
This diff is collapsed.
Click to expand it.
groundStation/src/cli/cli_setpid.c
+
15
−
4
View file @
a4474dc7
...
@@ -18,10 +18,10 @@ int cli_setpid(struct backend_conn * conn, int argc, char **argv) {
...
@@ -18,10 +18,10 @@ int cli_setpid(struct backend_conn * conn, int argc, char **argv) {
{
"roll"
,
no_argument
,
&
setRoll
,
1
},
{
"roll"
,
no_argument
,
&
setRoll
,
1
},
{
"pitch"
,
no_argument
,
&
setPitch
,
1
},
{
"pitch"
,
no_argument
,
&
setPitch
,
1
},
{
"yaw"
,
no_argument
,
&
setYaw
,
1
},
{
"yaw"
,
no_argument
,
&
setYaw
,
1
},
{
"rollv"
,
no_argument
,
&
set
Yaw
V
,
1
},
{
"rollv"
,
no_argument
,
&
set
Roll
V
,
1
},
{
"pitchv"
,
no_argument
,
&
set
Yaw
V
,
1
},
{
"pitchv"
,
no_argument
,
&
set
Pitch
V
,
1
},
{
"yawv"
,
no_argument
,
&
setYawV
,
1
},
{
"yawv"
,
no_argument
,
&
setYawV
,
1
},
{
"height"
,
no_argument
,
&
setHeight
,
1
},
{
"height"
,
no_argument
,
&
setHeight
,
1
},
{
"lat"
,
no_argument
,
&
setLat
,
1
},
{
"lat"
,
no_argument
,
&
setLat
,
1
},
{
"long"
,
no_argument
,
&
setLong
,
1
},
{
"long"
,
no_argument
,
&
setLong
,
1
},
{
0
,
0
,
0
,
0
}
{
0
,
0
,
0
,
0
}
...
@@ -62,9 +62,20 @@ int cli_setpid(struct backend_conn * conn, int argc, char **argv) {
...
@@ -62,9 +62,20 @@ int cli_setpid(struct backend_conn * conn, int argc, char **argv) {
pid_data
.
controller
=
PID_YAW
;
pid_data
.
controller
=
PID_YAW
;
}
else
if
(
setPitch
)
{
}
else
if
(
setPitch
)
{
pid_data
.
controller
=
PID_PITCH
;
pid_data
.
controller
=
PID_PITCH
;
}
else
if
(
setRollV
)
{
pid_data
.
controller
=
PID_ROLL_VELOCITY
;
}
else
if
(
setPitchV
)
{
pid_data
.
controller
=
PID_PITCH_VELOCITY
;
}
else
if
(
setYawV
)
{
pid_data
.
controller
=
PID_YAW_VELOCITY
;
}
else
if
(
setHeight
)
{
pid_data
.
controller
=
PID_HEIGHT
;
}
else
if
(
setLong
)
{
pid_data
.
controller
=
PID_LONG
;
}
else
if
(
setLat
)
{
pid_data
.
controller
=
PID_LAT
;
}
}
frontend_setpid
(
conn
,
&
pid_data
,
mask
);
frontend_setpid
(
conn
,
&
pid_data
,
mask
);
return
0
;
return
0
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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