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
c386bffc
Commit
c386bffc
authored
8 years ago
by
burneykb
Browse files
Options
Downloads
Patches
Plain Diff
added commands to commands.h/c
parent
abb2a21c
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
common/commands.c
+74
-0
74 additions, 0 deletions
common/commands.c
common/commands.h
+9
-32
9 additions, 32 deletions
common/commands.h
groundStation/src/backend/responseparam.c
+1
-1
1 addition, 1 deletion
groundStation/src/backend/responseparam.c
with
84 additions
and
33 deletions
common/commands.c
+
74
−
0
View file @
c386bffc
...
...
@@ -62,6 +62,17 @@ command_cb cb_setparam __attribute__((weak, alias("cb_default")));
command_cb
cb_getparam
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_respparam
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_setsource
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_getsource
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_respsource
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_getoutput
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_respoutput
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_getnodes
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_respnodes
__attribute__
((
weak
,
alias
(
"cb_default"
)));
/*
* Command structure.
* This array is used to keep track of the callback functions
...
...
@@ -165,6 +176,69 @@ struct MessageType MessageTypes[MAX_TYPE_ID] =
// Function pointer
&
cb_respparam
},
// SETSOURCE
{
// Command text
"setsource"
,
// Type of the command data
floatType
,
// Function pointer
&
cb_setsource
},
// GETSOURCE
{
// Command text
"getsource"
,
// Type of the command data
floatType
,
// Function pointer
&
cb_getsource
},
// RESPSOURCE
{
// Command text
"respsource"
,
// Type of the command data
floatType
,
// Function pointer
&
cb_respsource
},
// GETOUTPUT
{
// Command text
"getoutput"
,
// Type of the command data
floatType
,
// Function pointer
&
cb_respoutput
},
// RESPOUTPUT
{
// Command text
"respoutput"
,
// Type of the command data
floatType
,
// Function pointer
&
cb_respoutput
},
// GETNODES
{
// Command text
"getnodes"
,
// Type of the command data
floatType
,
// Function pointer
&
cb_getnodes
},
// RESPNODES
{
// Command text
"respnodes"
,
// Type of the command data
floatType
,
// Function pointer
&
cb_respnodes
},
// LOG_END
{
// Command text
...
...
This diff is collapsed.
Click to expand it.
common/commands.h
+
9
−
32
View file @
c386bffc
...
...
@@ -45,39 +45,16 @@ enum MessageTypeID{
SETPARAM_ID
,
// 07 - Setting controller parameters. Example: PID constants
GETPARAM_ID
,
// 08 - Getting controller parameters. Example: PID constants
RESPPARAM_ID
,
// 09 - Responding with controller parameters. Example: PID constants
LOG_END_ID
,
// 10 - Responding with controller parameters. Example: PID constants
MAX_TYPE_ID
// 11 - Just used to keep track of the size. Must remain at the end
SETSOURCE_ID
,
// 10 - Setting controller source Block & id
GETSOURCE_ID
,
// 11 - Getting controller source Block & id
RESPSOURCE_ID
,
// 12 - Responding with controller source Block & id
GETOUTPUT_ID
,
// 13 - Getting controller block output
RESPOUTPUT_ID
,
// 14 - Responding with controller block output
GETNODES_ID
,
// 15 - Getting nodes from current comp_graph
RESPNODES_ID
,
// 16 - Responding with nodes from current comp_graph
LOG_END_ID
,
// 17 - Responding with controller parameters. Example: PID constants
MAX_TYPE_ID
// 18 - Just used to keep track of the size. Must remain at the end
};
/*
* Controller ID used to know which controller the message is referencing
*/
enum
ControllerID
{
ROLL_ID
,
// 00 - Roll PID
PITCH_ID
,
// 01 - Pitch PID
YAW_ID
,
// 02 - Yaw PID
ROLL_RATE_ID
,
// 03 - Roll rate PID
PITCH_RATE_ID
,
// 04 - Pitch rate PID
YAW_RATE_ID
,
// 05 - Yaw rate PID
LOCAL_X_ID
,
// 06 - Local X PID // lat
LOCAL_Y_ID
,
// 07 - Local Y PID //long
ALT_ID
,
// 08 - Altitude PID
X_SETPOINT_ID
,
// 09 - X Setpoint //lat
Y_SETPOINT_ID
,
// 10 - Y Setpoint //long
ALT_SETPOINT_ID
,
// 11 - Z Setpoint
MAX_CONTROLLER_ID
// 12 - Just used to keep track of the size
};
/*
* Enumeration of controller parameters
*/
enum
ControlParamID
{
KP_ID
,
// 00 - P constant
KI_ID
,
// 01 - I constant
KD_ID
,
// 02 - D constant
MAX_CONTROL_PARAM_ID
,
// 03 - Just used to keep track of the size
};
/*
* Message type struct used to keep track of the callback function
* pointers located in commands.c
...
...
This diff is collapsed.
Click to expand it.
groundStation/src/backend/responseparam.c
+
1
−
1
View file @
c386bffc
...
...
@@ -14,7 +14,7 @@ enum ResponseData {
RESP_DATA_SIZE
};
/* Creates data and metadata for a resp
control
packet
/* Creates data and metadata for a resp
param
packet
* Returns data size.
*/
ssize_t
EncodeResponseParam
(
...
...
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