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
64f0201b
Commit
64f0201b
authored
8 years ago
by
dawehr
Browse files
Options
Downloads
Patches
Plain Diff
Undoing accidental commits to commands.c and quad callbacks.c.
parent
29cb319f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
groundStation/src/backend/commands.c
+93
-99
93 additions, 99 deletions
groundStation/src/backend/commands.c
quad/sw/modular_quad_pid/src/callbacks.c
+14
-345
14 additions, 345 deletions
quad/sw/modular_quad_pid/src/callbacks.c
with
107 additions
and
444 deletions
groundStation/src/backend/commands.c
+
93
−
99
View file @
64f0201b
...
...
@@ -74,20 +74,18 @@ command_cb cb_setrollrated __attribute__((weak, alias("cb_default")));
command_cb
cb_setpitchratep
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_setpitchratei
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_setpitchrated
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_set
x
p
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_set
x
i
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_set
x
d
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_set
y
p
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_set
y
i
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_set
y
d
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_set
lat
p
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_set
lat
i
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_set
lat
d
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_set
long
p
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_set
long
i
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_set
long
d
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_setheightp
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_setheighti
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_setheightd
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_setheight
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_setx
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_sety
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_setlon
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_setlat
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_setlong
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_setyaw
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_setpitch
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_setroll
__attribute__
((
weak
,
alias
(
"cb_default"
)));
...
...
@@ -111,20 +109,18 @@ command_cb cb_getrollrated __attribute__((weak, alias("cb_default")));
command_cb
cb_getpitchratep
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_getpitchratei
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_getpitchrated
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_get
x
p
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_get
x
i
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_get
x
d
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_get
y
p
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_get
y
i
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_get
y
d
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_get
lat
p
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_get
lat
i
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_get
lat
d
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_get
long
p
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_get
long
i
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_get
long
d
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_getheightp
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_getheighti
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_getheightd
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_getheight
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_getx
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_gety
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_getlon
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_getlat
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_getlong
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_getyaw
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_getpitch
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_getroll
__attribute__
((
weak
,
alias
(
"cb_default"
)));
...
...
@@ -148,20 +144,18 @@ command_cb cb_resprollrated __attribute__((weak, alias("cb_default")));
command_cb
cb_resppitchratep
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_resppitchratei
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_resppitchrated
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_resp
x
p
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_resp
x
i
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_resp
x
d
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_resp
y
p
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_resp
y
i
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_resp
y
d
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_resp
lat
p
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_resp
lat
i
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_resp
lat
d
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_resp
long
p
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_resp
long
i
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_resp
long
d
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_respheightp
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_respheighti
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_respheightd
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_respheight
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_respx
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_respy
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_resplon
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_resplat
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_resplong
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_respyaw
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_resppitch
__attribute__
((
weak
,
alias
(
"cb_default"
)));
command_cb
cb_resproll
__attribute__
((
weak
,
alias
(
"cb_default"
)));
...
...
@@ -450,71 +444,71 @@ struct MessageType MessageTypes[MAX_TYPE] =
// Function pointer
&
cb_setheightd
},
//
x
p constant subtype
//
lat
p constant subtype
{
// ID
0x15
,
// Command text
"set
x
p"
,
"set
lat
p"
,
// Type of the command data
floatType
,
// Function pointer
&
cb_set
x
p
&
cb_set
lat
p
},
//
x
i constant subtype
//
lat
i constant subtype
{
// ID
0x16
,
// Command text
"set
x
i"
,
"set
lat
i"
,
// Type of the command data
floatType
,
// Function pointer
&
cb_set
x
i
&
cb_set
lat
i
},
//
x
d constant subtype
//
lat
d constant subtype
{
// ID
0x17
,
// Command text
"set
x
d"
,
"set
lat
d"
,
// Type of the command data
floatType
,
// Function pointer
&
cb_set
x
d
&
cb_set
lat
d
},
//
y
p constant subtype
//
long
p constant subtype
{
// ID
0x18
,
// Command text
"set
y
p"
,
"set
long
p"
,
// Type of the command data
floatType
,
// Function pointer
&
cb_set
y
p
&
cb_set
long
p
},
//
y
i constant subtype
//
long
i constant subtype
{
// ID
0x19
,
// Command text
"set
y
i"
,
"set
long
i"
,
// Type of the command data
floatType
,
// Function pointer
&
cb_set
y
i
&
cb_set
long
i
},
//
y
d constant subtype
//
long
d constant subtype
{
// ID
0x1A
,
// Command text
"set
y
d"
,
"set
long
d"
,
// Type of the command data
floatType
,
// Function pointer
&
cb_set
y
d
&
cb_set
long
d
},
// height setpoint subtype
{
...
...
@@ -527,27 +521,27 @@ struct MessageType MessageTypes[MAX_TYPE] =
// Function pointer
&
cb_setheight
},
//
x
setpoint subtype
//
lat
setpoint subtype
{
// ID
0x1C
,
// Command text
"set
x
"
,
"set
lat
"
,
// Type of the command data
floatType
,
// Function pointer
&
cb_set
x
&
cb_set
lat
},
//
y
setpoint subtype
//
long
setpoint subtype
{
// ID
0x1D
,
// Command text
"set
y
"
,
"set
long
"
,
// Type of the command data
floatType
,
// Function pointer
&
cb_set
y
&
cb_set
long
},
// yaw setpoint subtype
{
...
...
@@ -823,71 +817,71 @@ struct MessageType MessageTypes[MAX_TYPE] =
// Function pointer
&
cb_getheightd
},
//
x
p constant subtype
//
lat
p constant subtype
{
// ID
0x15
,
// Command text
"get
x
p"
,
"get
lat
p"
,
// Type of the command data
floatType
,
// Function pointer
&
cb_get
x
p
&
cb_get
lat
p
},
//
x
i constant subtype
//
lat
i constant subtype
{
// ID
0x16
,
// Command text
"get
x
i"
,
"get
lat
i"
,
// Type of the command data
floatType
,
// Function pointer
&
cb_get
x
i
&
cb_get
lat
i
},
//
x
d constant subtype
//
lat
d constant subtype
{
// ID
0x17
,
// Command text
"get
x
d"
,
"get
lat
d"
,
// Type of the command data
floatType
,
// Function pointer
&
cb_get
x
d
&
cb_get
lat
d
},
//
y
p constant subtype
//
long
p constant subtype
{
// ID
0x18
,
// Command text
"get
y
p"
,
"get
long
p"
,
// Type of the command data
floatType
,
// Function pointer
&
cb_get
y
p
&
cb_get
long
p
},
//
y
i constant subtype
//
long
i constant subtype
{
// ID
0x19
,
// Command text
"get
y
i"
,
"get
long
i"
,
// Type of the command data
floatType
,
// Function pointer
&
cb_get
y
i
&
cb_get
long
i
},
//
y
d constant subtype
//
long
d constant subtype
{
// ID
0x1A
,
// Command text
"get
y
d"
,
"get
long
d"
,
// Type of the command data
floatType
,
// Function pointer
&
cb_get
y
d
&
cb_get
long
d
},
// height setpoint subtype
{
...
...
@@ -900,27 +894,27 @@ struct MessageType MessageTypes[MAX_TYPE] =
// Function pointer
&
cb_getheight
},
//
x
getpoint subtype
//
lat
getpoint subtype
{
// ID
0x1C
,
// Command text
"get
x
"
,
"get
lat
"
,
// Type of the command data
floatType
,
// Function pointer
&
cb_get
x
&
cb_get
lat
},
//
y
getpoint subtype
//
long
getpoint subtype
{
// ID
0x1D
,
// Command text
"get
y
"
,
"get
long
"
,
// Type of the command data
floatType
,
// Function pointer
&
cb_get
y
&
cb_get
long
},
// yaw getpoint subtype
{
...
...
@@ -1197,71 +1191,71 @@ struct MessageType MessageTypes[MAX_TYPE] =
// Function pointer
&
cb_respheightd
},
//
x
p constant subtype
//
lat
p constant subtype
{
// ID
0x15
,
// Command text
"resp
x
p"
,
"resp
lat
p"
,
// Type of the command data
floatType
,
// Function pointer
&
cb_resp
x
p
&
cb_resp
lat
p
},
//
x
i constant subtype
//
lat
i constant subtype
{
// ID
0x16
,
// Command text
"resp
x
i"
,
"resp
lat
i"
,
// Type of the command data
floatType
,
// Function pointer
&
cb_resp
x
i
&
cb_resp
lat
i
},
//
x
d constant subtype
//
lat
d constant subtype
{
// ID
0x17
,
// Command text
"resp
x
d"
,
"resp
lat
d"
,
// Type of the command data
floatType
,
// Function pointer
&
cb_resp
x
d
&
cb_resp
lat
d
},
//
y
p constant subtype
//
long
p constant subtype
{
// ID
0x18
,
// Command text
"resp
y
p"
,
"resp
long
p"
,
// Type of the command data
floatType
,
// Function pointer
&
cb_resp
y
p
&
cb_resp
long
p
},
//
y
i constant subtype
//
long
i constant subtype
{
// ID
0x19
,
// Command text
"resp
y
i"
,
"resp
long
i"
,
// Type of the command data
floatType
,
// Function pointer
&
cb_resp
y
i
&
cb_resp
long
i
},
//
y
d constant subtype
//
long
d constant subtype
{
// ID
0x1A
,
// Command text
"resp
y
d"
,
"resp
long
d"
,
// Type of the command data
floatType
,
// Function pointer
&
cb_resp
y
d
&
cb_resp
long
d
},
// height setpoint subtype
{
...
...
@@ -1274,27 +1268,27 @@ struct MessageType MessageTypes[MAX_TYPE] =
// Function pointer
&
cb_respheight
},
//
x
resppoint subtype
//
lat
resppoint subtype
{
// ID
0x1C
,
// Command text
"resp
x
"
,
"resp
lat
"
,
// Type of the command data
floatType
,
// Function pointer
&
cb_resp
x
&
cb_resp
lat
},
//
y
resppoint subtype
//
long
resppoint subtype
{
// ID
0x1D
,
// Command text
"resp
y
"
,
"resp
long
"
,
// Type of the command data
floatType
,
// Function pointer
&
cb_resp
y
&
cb_resp
long
},
// yaw resppoint subtype
{
...
...
This diff is collapsed.
Click to expand it.
quad/sw/modular_quad_pid/src/callbacks.c
+
14
−
345
View file @
64f0201b
...
...
@@ -63,9 +63,6 @@ int cb_update(modular_structs_t *structs)
return
0
;
}
/* Misc. callbacks */
// This is called on the ground station to begin sending VRPN to the quad
int
cb_beginupdate
(
modular_structs_t
*
structs
)
{
structs
->
user_input_struct
.
receivedBeginUpdate
=
1
;
...
...
@@ -86,18 +83,15 @@ int cb_response(modular_structs_t *structs)
return
0
;
}
/* Callbacks for configuration (setters)*/
int
cb_setyawp
(
modular_structs_t
*
structs
)
int
cb_setyaw
(
modular_structs_t
*
structs
)
{
structs
->
parameter_struct
.
yaw_angle_pid
.
Kp
=
uart_buff_data_get_float
(
0
);
structs
->
setpoint_struct
.
desiredQuadPosition
.
yaw
=
uart_buff_data_get_float
(
0
);
return
0
;
}
int
cb_setyaw
i
(
modular_structs_t
*
structs
)
int
cb_setyaw
p
(
modular_structs_t
*
structs
)
{
structs
->
parameter_struct
.
yaw_angle_pid
.
K
i
=
uart_buff_data_get_float
(
0
);
structs
->
parameter_struct
.
yaw_angle_pid
.
K
p
=
uart_buff_data_get_float
(
0
);
return
0
;
}
...
...
@@ -107,15 +101,15 @@ int cb_setyawd(modular_structs_t *structs)
return
0
;
}
int
cb_setroll
p
(
modular_structs_t
*
structs
)
int
cb_setroll
(
modular_structs_t
*
structs
)
{
structs
->
parameter_struct
.
roll_angle_pid
.
Kp
=
uart_buff_data_get_float
(
0
);
structs
->
setpoint_struct
.
desiredQuadPosition
.
roll
=
uart_buff_data_get_float
(
0
);
return
0
;
}
int
cb_setroll
i
(
modular_structs_t
*
structs
)
int
cb_setroll
p
(
modular_structs_t
*
structs
)
{
structs
->
parameter_struct
.
roll_angle_pid
.
K
i
=
uart_buff_data_get_float
(
0
);
structs
->
parameter_struct
.
roll_angle_pid
.
K
p
=
uart_buff_data_get_float
(
0
);
return
0
;
}
...
...
@@ -125,15 +119,15 @@ int cb_setrolld(modular_structs_t *structs)
return
0
;
}
int
cb_setpitch
p
(
modular_structs_t
*
structs
)
int
cb_setpitch
(
modular_structs_t
*
structs
)
{
structs
->
parameter_struct
.
pitch_angle_pid
.
Kp
=
uart_buff_data_get_float
(
0
);
structs
->
setpoint_struct
.
desiredQuadPosition
.
pitch
=
uart_buff_data_get_float
(
0
);
return
0
;
}
int
cb_setpitch
i
(
modular_structs_t
*
structs
)
int
cb_setpitch
p
(
modular_structs_t
*
structs
)
{
structs
->
parameter_struct
.
pitch_angle_pid
.
K
i
=
uart_buff_data_get_float
(
0
);
structs
->
parameter_struct
.
pitch_angle_pid
.
K
p
=
uart_buff_data_get_float
(
0
);
return
0
;
}
...
...
@@ -143,93 +137,9 @@ int cb_setpitchd(modular_structs_t *structs)
return
0
;
}
int
cb_setyawratep
(
modular_structs_t
*
structs
)
{
structs
->
parameter_struct
.
yaw_ang_vel_pid
.
Kp
=
uart_buff_data_get_float
(
0
);
return
0
;
}
int
cb_setyawratei
(
modular_structs_t
*
structs
)
{
structs
->
parameter_struct
.
yaw_ang_vel_pid
.
Ki
=
uart_buff_data_get_float
(
0
);
return
0
;
}
int
cb_setyawrated
(
modular_structs_t
*
structs
)
{
structs
->
parameter_struct
.
yaw_ang_vel_pid
.
Kd
=
uart_buff_data_get_float
(
0
);
return
0
;
}
int
cb_setrollratep
(
modular_structs_t
*
structs
)
{
structs
->
parameter_struct
.
roll_ang_vel_pid
.
Kp
=
uart_buff_data_get_float
(
0
);
return
0
;
}
int
cb_setrollratei
(
modular_structs_t
*
structs
)
{
structs
->
parameter_struct
.
roll_ang_vel_pid
.
Ki
=
uart_buff_data_get_float
(
0
);
return
0
;
}
int
cb_setrollrated
(
modular_structs_t
*
structs
)
{
structs
->
parameter_struct
.
roll_ang_vel_pid
.
Kd
=
uart_buff_data_get_float
(
0
);
return
0
;
}
int
cb_setpitchratep
(
modular_structs_t
*
structs
)
{
structs
->
parameter_struct
.
pitch_ang_vel_pid
.
Kp
=
uart_buff_data_get_float
(
0
);
return
0
;
}
int
cb_setpitchratei
(
modular_structs_t
*
structs
)
{
structs
->
parameter_struct
.
pitch_ang_vel_pid
.
Ki
=
uart_buff_data_get_float
(
0
);
return
0
;
}
int
cb_setpitchrated
(
modular_structs_t
*
structs
)
{
structs
->
parameter_struct
.
pitch_ang_vel_pid
.
Kd
=
uart_buff_data_get_float
(
0
);
return
0
;
}
int
cb_setxp
(
modular_structs_t
*
structs
)
{
structs
->
parameter_struct
.
local_x_pid
.
Kp
=
uart_buff_data_get_float
(
0
);
return
0
;
}
int
cb_setxi
(
modular_structs_t
*
structs
)
{
structs
->
parameter_struct
.
local_x_pid
.
Ki
=
uart_buff_data_get_float
(
0
);
return
0
;
}
int
cb_setxd
(
modular_structs_t
*
structs
)
{
structs
->
parameter_struct
.
local_x_pid
.
Kd
=
uart_buff_data_get_float
(
0
);
return
0
;
}
int
cb_setyp
(
modular_structs_t
*
structs
)
{
structs
->
parameter_struct
.
local_y_pid
.
Kp
=
uart_buff_data_get_float
(
0
);
return
0
;
}
int
cb_setyi
(
modular_structs_t
*
structs
)
{
structs
->
parameter_struct
.
local_y_pid
.
Ki
=
uart_buff_data_get_float
(
0
);
return
0
;
}
int
cb_setyd
(
modular_structs_t
*
structs
)
int
cb_setheight
(
modular_structs_t
*
structs
)
{
structs
->
parameter_struct
.
local_y_pid
.
Kd
=
uart_buff_data_get_float
(
0
);
structs
->
setpoint_struct
.
desiredQuadPosition
.
alt_pos
=
uart_buff_data_get_float
(
0
);
return
0
;
}
...
...
@@ -247,244 +157,3 @@ int cb_setheightd(modular_structs_t *structs)
{
structs
->
parameter_struct
.
alt_pid
.
Kd
=
uart_buff_data_get_float
(
0
);
}
int
cb_setheight
(
modular_structs_t
*
structs
)
{
structs
->
setpoint_struct
.
desiredQuadPosition
.
alt_pos
=
uart_buff_data_get_float
(
0
);
return
0
;
}
int
cb_setx
(
modular_structs_t
*
structs
)
{
structs
->
setpoint_struct
.
desiredQuadPosition
.
x_pos
=
uart_buff_data_get_float
(
0
);
return
0
;
}
// TODO cb_sety will replace cb_setlat in commands.c once we talk about it
int
cb_sety
(
modular_structs_t
*
structs
)
{
structs
->
setpoint_struct
.
desiredQuadPosition
.
y_pos
=
uart_buff_data_get_float
(
0
);
return
0
;
}
int
cb_setlon
(
modular_structs_t
*
structs
)
{
// TODO need to be able to take in a lat, lon position and convert it to quad x, y pos
return
0
;
}
int
cb_setlat
(
modular_structs_t
*
structs
)
{
// TODO need to be able to take in a lat, lon position and convert it to quad x, y pos
return
0
;
}
int
cb_setyaw
(
modular_structs_t
*
structs
)
{
structs
->
setpoint_struct
.
desiredQuadPosition
.
yaw
=
uart_buff_data_get_float
(
0
);
return
0
;
}
int
cb_setpitch
(
modular_structs_t
*
structs
)
{
structs
->
setpoint_struct
.
desiredQuadPosition
.
pitch
=
uart_buff_data_get_float
(
0
);
return
0
;
}
int
cb_setroll
(
modular_structs_t
*
structs
)
{
structs
->
setpoint_struct
.
desiredQuadPosition
.
roll
=
uart_buff_data_get_float
(
0
);
return
0
;
}
/* callbacks for getters */
int
cb_getyawp
(
modular_structs_t
*
structs
)
{
char
buf
[
255
];
// Message logging number of messages received and size of payload received
int
length
=
snprintf
(
buf
,
sizeof
buf
,
"%f"
,
structs
->
parameter_struct
.
yaw_angle_pid
.
Kp
);
send_data
(
MessageTypes
[
2
].
ID
,
MessageTypes
[
2
].
subtypes
[
0
].
ID
,
0
,
buf
,
length
>=
sizeof
(
buf
)
?
255
:
length
+
1
);
return
0
;
}
int
cb_getyawi
(
modular_structs_t
*
structs
)
{
char
buf
[
255
];
// Message logging number of messages received and size of payload received
int
length
=
snprintf
(
buf
,
sizeof
buf
,
"%f"
,
structs
->
parameter_struct
.
yaw_angle_pid
.
Ki
);
send_data
(
MessageTypes
[
2
].
ID
,
MessageTypes
[
2
].
subtypes
[
1
].
ID
,
0
,
buf
,
length
>=
sizeof
(
buf
)
?
255
:
length
+
1
);
return
0
;
}
int
cb_getyawd
(
modular_structs_t
*
structs
)
{
char
buf
[
255
];
// Message logging number of messages received and size of payload received
int
length
=
snprintf
(
buf
,
sizeof
buf
,
"%f"
,
structs
->
parameter_struct
.
yaw_angle_pid
.
Kd
);
send_data
(
MessageTypes
[
2
].
ID
,
MessageTypes
[
2
].
subtypes
[
2
].
ID
,
0
,
buf
,
length
>=
sizeof
(
buf
)
?
255
:
length
+
1
);
return
0
;
}
int
cb_getrollp
(
modular_structs_t
*
structs
)
{
char
buf
[
255
];
// Message logging number of messages received and size of payload received
int
length
=
snprintf
(
buf
,
sizeof
buf
,
"%f"
,
structs
->
parameter_struct
.
roll_angle_pid
.
Kp
);
send_data
(
MessageTypes
[
2
].
ID
,
MessageTypes
[
2
].
subtypes
[
3
].
ID
,
0
,
buf
,
length
>=
sizeof
(
buf
)
?
255
:
length
+
1
);
return
0
;
}
int
cb_getrolli
(
modular_structs_t
*
structs
)
{
char
buf
[
255
];
// Message logging number of messages received and size of payload received
int
length
=
snprintf
(
buf
,
sizeof
buf
,
"%f"
,
structs
->
parameter_struct
.
roll_angle_pid
.
Ki
);
send_data
(
MessageTypes
[
2
].
ID
,
MessageTypes
[
2
].
subtypes
[
4
].
ID
,
0
,
buf
,
length
>=
sizeof
(
buf
)
?
255
:
length
+
1
);
return
0
;
}
int
cb_getrolld
(
modular_structs_t
*
structs
)
{
char
buf
[
255
];
// Message logging number of messages received and size of payload received
int
length
=
snprintf
(
buf
,
sizeof
buf
,
"%f"
,
structs
->
parameter_struct
.
roll_angle_pid
.
Kd
);
send_data
(
MessageTypes
[
2
].
ID
,
MessageTypes
[
2
].
subtypes
[
5
].
ID
,
0
,
buf
,
length
>=
sizeof
(
buf
)
?
255
:
length
+
1
);
return
0
;
}
int
cb_getpitchp
(
modular_structs_t
*
structs
)
{
char
buf
[
255
];
// Message logging number of messages received and size of payload received
int
length
=
snprintf
(
buf
,
sizeof
buf
,
"%f"
,
structs
->
parameter_struct
.
pitch_angle_pid
.
Kp
);
send_data
(
MessageTypes
[
2
].
ID
,
MessageTypes
[
2
].
subtypes
[
6
].
ID
,
0
,
buf
,
length
>=
sizeof
(
buf
)
?
255
:
length
+
1
);
return
0
;
}
int
cb_getpitchi
(
modular_structs_t
*
structs
)
{
char
buf
[
255
];
// Message logging number of messages received and size of payload received
int
length
=
snprintf
(
buf
,
sizeof
buf
,
"%f"
,
structs
->
parameter_struct
.
pitch_angle_pid
.
Ki
);
send_data
(
MessageTypes
[
2
].
ID
,
MessageTypes
[
2
].
subtypes
[
7
].
ID
,
0
,
buf
,
length
>=
sizeof
(
buf
)
?
255
:
length
+
1
);
return
0
;
}
int
cb_getpitchd
(
modular_structs_t
*
structs
)
{
char
buf
[
255
];
// Message logging number of messages received and size of payload received
int
length
=
snprintf
(
buf
,
sizeof
buf
,
"%f"
,
structs
->
parameter_struct
.
pitch_angle_pid
.
Kd
);
send_data
(
MessageTypes
[
2
].
ID
,
MessageTypes
[
2
].
subtypes
[
8
].
ID
,
0
,
buf
,
length
>=
sizeof
(
buf
)
?
255
:
length
+
1
);
return
0
;
}
int
cb_getyawratep
(
modular_structs_t
*
structs
)
{
char
buf
[
255
];
// Message logging number of messages received and size of payload received
int
length
=
snprintf
(
buf
,
sizeof
buf
,
"%f"
,
structs
->
parameter_struct
.
yaw_ang_vel_pid
.
Kp
);
send_data
(
MessageTypes
[
2
].
ID
,
MessageTypes
[
2
].
subtypes
[
9
].
ID
,
0
,
buf
,
length
>=
sizeof
(
buf
)
?
255
:
length
+
1
);
return
0
;
}
int
cb_getyawratei
(
modular_structs_t
*
structs
)
{
char
buf
[
255
];
// Message logging number of messages received and size of payload received
int
length
=
snprintf
(
buf
,
sizeof
buf
,
"%f"
,
structs
->
parameter_struct
.
yaw_ang_vel_pid
.
Ki
);
send_data
(
MessageTypes
[
2
].
ID
,
MessageTypes
[
2
].
subtypes
[
10
].
ID
,
0
,
buf
,
length
>=
sizeof
(
buf
)
?
255
:
length
+
1
);
return
0
;
}
int
cb_getyawrated
(
modular_structs_t
*
structs
)
{
char
buf
[
255
];
// Message logging number of messages received and size of payload received
int
length
=
snprintf
(
buf
,
sizeof
buf
,
"%f"
,
structs
->
parameter_struct
.
yaw_ang_vel_pid
.
Kd
);
send_data
(
MessageTypes
[
2
].
ID
,
MessageTypes
[
2
].
subtypes
[
11
].
ID
,
0
,
buf
,
length
>=
sizeof
(
buf
)
?
255
:
length
+
1
);
return
0
;
}
int
cb_getrollratep
(
modular_structs_t
*
structs
)
{
char
buf
[
255
];
// Message logging number of messages received and size of payload received
int
length
=
snprintf
(
buf
,
sizeof
buf
,
"%f"
,
structs
->
parameter_struct
.
roll_ang_vel_pid
.
Kp
);
send_data
(
MessageTypes
[
2
].
ID
,
MessageTypes
[
2
].
subtypes
[
12
].
ID
,
0
,
buf
,
length
>=
sizeof
(
buf
)
?
255
:
length
+
1
);
return
0
;
}
int
cb_getrollratei
(
modular_structs_t
*
structs
)
{
char
buf
[
255
];
// Message logging number of messages received and size of payload received
int
length
=
snprintf
(
buf
,
sizeof
buf
,
"%f"
,
structs
->
parameter_struct
.
roll_ang_vel_pid
.
Ki
);
send_data
(
MessageTypes
[
2
].
ID
,
MessageTypes
[
2
].
subtypes
[
13
].
ID
,
0
,
buf
,
length
>=
sizeof
(
buf
)
?
255
:
length
+
1
);
return
0
;
}
int
cb_getrollrated
(
modular_structs_t
*
structs
)
{
char
buf
[
255
];
// Message logging number of messages received and size of payload received
int
length
=
snprintf
(
buf
,
sizeof
buf
,
"%f"
,
structs
->
parameter_struct
.
roll_ang_vel_pid
.
Kd
);
send_data
(
MessageTypes
[
2
].
ID
,
MessageTypes
[
2
].
subtypes
[
14
].
ID
,
0
,
buf
,
length
>=
sizeof
(
buf
)
?
255
:
length
+
1
);
return
0
;
}
int
cb_getpitchratep
(
modular_structs_t
*
structs
)
{
char
buf
[
255
];
// Message logging number of messages received and size of payload received
int
length
=
snprintf
(
buf
,
sizeof
buf
,
"%f"
,
structs
->
parameter_struct
.
pitch_ang_vel_pid
.
Kp
);
send_data
(
MessageTypes
[
2
].
ID
,
MessageTypes
[
2
].
subtypes
[
15
].
ID
,
0
,
buf
,
length
>=
sizeof
(
buf
)
?
255
:
length
+
1
);
return
0
;
}
int
cb_getpitchratei
(
modular_structs_t
*
structs
)
{
char
buf
[
255
];
// Message logging number of messages received and size of payload received
int
length
=
snprintf
(
buf
,
sizeof
buf
,
"%f"
,
structs
->
parameter_struct
.
pitch_ang_vel_pid
.
Ki
);
send_data
(
MessageTypes
[
2
].
ID
,
MessageTypes
[
2
].
subtypes
[
16
].
ID
,
0
,
buf
,
length
>=
sizeof
(
buf
)
?
255
:
length
+
1
);
return
0
;
}
int
cb_getpitchrated
(
modular_structs_t
*
structs
)
{
char
buf
[
255
];
// Message logging number of messages received and size of payload received
int
length
=
snprintf
(
buf
,
sizeof
buf
,
"%f"
,
structs
->
parameter_struct
.
pitch_ang_vel_pid
.
Kd
);
send_data
(
MessageTypes
[
2
].
ID
,
MessageTypes
[
2
].
subtypes
[
17
].
ID
,
0
,
buf
,
length
>=
sizeof
(
buf
)
?
255
:
length
+
1
);
return
0
;
}
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