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
b59b3844
Unverified
Commit
b59b3844
authored
8 years ago
by
Jake Drahos
Browse files
Options
Downloads
Patches
Plain Diff
Added usage and examples to readme
parent
379e1545
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
groundStation/README.md
+38
-0
38 additions, 0 deletions
groundStation/README.md
groundStation/src/cli/cli_monitor.c
+12
-3
12 additions, 3 deletions
groundStation/src/cli/cli_monitor.c
with
50 additions
and
3 deletions
groundStation/README.md
+
38
−
0
View file @
b59b3844
...
...
@@ -23,3 +23,41 @@ If you wish to change the way the backend communicates to the quad and vice vers
## Modifying
See MODIFYING for the software architecture/organization and how to add new functionality.
## Using
First, the backend daemon must be running. Run the backend with ./BackEnd. Note
the environment variables in config.h, especially the backend socket path. The backend
requires root for bluetooth, but can run as a normal user with TCP, as long as the
socket path is writable by the user.
Once the backend is running, various CLI tools can be used to view the state of the
quad and send commands. Each of these tools is given as the first argument
to the CLI program, for example, to monitor the quad, use
`cli monitor`
. Note that
the backend socket environment variable must be set to the same value as it
was for the backend. The CLI program also supports busybox-style symbolic links.
For example, if there is a symlink named
`monitor`
that points to the
`cli`
binary,
running the
`monitor`
program will effectively run
`cli monitor`
.
The names of the binaries is subject to change.
### Example
In one terminal or screen, run the backend:
`UCART_SOCKET=./ucart.socket ./BackEnd`
This will activate the quad and the backend, and the backend will be available for
connections from the frontend tools. One useful tool is the monitor. In another
terminal window, run the monitor forever:
`UCART_SOCKET=./ucart.socket ./cli monitor -f`
This will begin a periodic monitoring that updates 10 times per second.
Finally, in a third window, export the socket path:
`export UCART_SOCKET=./ucart.socket`
and then run any other tools to modify the quad, for example modifying PID constants:
`./cli setpid --pitch -p 1.000`
This diff is collapsed.
Click to expand it.
groundStation/src/cli/cli_monitor.c
+
12
−
3
View file @
b59b3844
...
...
@@ -18,8 +18,10 @@ int cli_monitor(struct backend_conn * conn, int argc, char **argv) {
static
struct
timespec
elapsedTime
;
static
struct
timespec
lastChecked
;
static
int
nsecs
,
rate
=
10
;
static
int
forever
=
0
;
while
((
c
=
getopt
(
argc
,
argv
,
"t:r:"
))
!=
-
1
)
{
while
((
c
=
getopt
(
argc
,
argv
,
"ft:r:"
))
!=
-
1
)
{
switch
(
c
)
{
case
't'
:
nsecs
=
atoi
(
optarg
);
...
...
@@ -28,12 +30,19 @@ int cli_monitor(struct backend_conn * conn, int argc, char **argv) {
case
'r'
:
rate
=
atoi
(
optarg
)
+
1
;
break
;
case
'f'
:
forever
=
1
;
break
;
default
:
break
;
}
}
if
(
timeFlag
)
{
if
(
forever
)
{
for
(;;)
{
monitor
(
conn
);
}
}
else
if
(
timeFlag
)
{
clock_gettime
(
CLOCK_REALTIME
,
&
startTime
);
clock_gettime
(
CLOCK_REALTIME
,
&
lastChecked
);
while
((
result
=
monitor
(
conn
))
==
0
)
{
...
...
@@ -82,4 +91,4 @@ static void timespec_diff(struct timespec *start, struct timespec *result)
}
return
;
}
\ 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