Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cm510_controller_fw
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
humanoides
cm510_controller_fw
Commits
01cfef16
Commit
01cfef16
authored
9 years ago
by
Antonio Gabás
Browse files
Options
Downloads
Patches
Plain Diff
[bioloid_robot] Added function to read increments from compass
parent
e8e11ee5
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
dyn_devices/include/exp_board.h
+2
-0
2 additions, 0 deletions
dyn_devices/include/exp_board.h
dyn_devices/src/exp_board/exp_board.c
+16
-0
16 additions, 0 deletions
dyn_devices/src/exp_board/exp_board.c
with
18 additions
and
0 deletions
dyn_devices/include/exp_board.h
+
2
−
0
View file @
01cfef16
...
...
@@ -25,6 +25,8 @@ unsigned short int get_adc_avg_channel(unsigned char channel_id);
// compass interface
unsigned
short
int
get_heading
(
void
);
unsigned
short
int
get_avg_heading
(
void
);
unsigned
short
int
get_avg_heading_inc
(
unsigned
short
int
initial_compass
);
// UART inetrface
unsigned
char
uart_send_byte
(
unsigned
char
data
);
unsigned
char
uart_send_vector
(
unsigned
char
*
data
,
unsigned
int
length
);
...
...
This diff is collapsed.
Click to expand it.
dyn_devices/src/exp_board/exp_board.c
+
16
−
0
View file @
01cfef16
...
...
@@ -79,6 +79,22 @@ unsigned short int get_avg_heading(void)
return
0xFFFF
;
//error
}
unsigned
short
int
get_avg_heading_inc
(
unsigned
short
int
initial_compass
)
{
short
int
actual_compass
;
short
int
increase
;
actual_compass
=
dxl_read_word
(
exp_board_id
,
COMPASS_AVG
);
increase
=
actual_compass
-
(
short
int
)
initial_compass
;
if
(
increase
<-
1800
){
increase
=
increase
+
3600
;
}
else
if
(
increase
>
1800
){
increase
=
increase
-
3600
;
}
return
increase
;
}
// UART inetrface
unsigned
char
uart_send_byte
(
unsigned
char
data
)
{
...
...
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