Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
segway_rmp_200
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
labrobotica
drivers
segway_rmp_200
Commits
8e10ed89
Commit
8e10ed89
authored
14 years ago
by
Joan Perez Ibarz
Browse files
Options
Downloads
Patches
Plain Diff
changing from servo_frames to uptime for easier comprehension
parent
e58b5937
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
src/segway_rmp200.cpp
+6
-6
6 additions, 6 deletions
src/segway_rmp200.cpp
src/segway_rmp200.h
+15
-15
15 additions, 15 deletions
src/segway_rmp200.h
with
21 additions
and
21 deletions
src/segway_rmp200.cpp
+
6
−
6
View file @
8e10ed89
...
...
@@ -53,7 +53,7 @@ void CSegwayRMP200::init_attributes(void)
this
->
roll_angle
=
0.0
;
this
->
roll_rate
=
0.0
;
this
->
yaw_rate
=
0.0
;
this
->
servo_fra
me
s
=
0.0
;
this
->
upti
me
=
0.0
;
this
->
left_wheel_displ
=
0.0
;
this
->
right_wheel_displ
=
0.0
;
this
->
forward_displ
=
0.0
;
...
...
@@ -278,7 +278,7 @@ void CSegwayRMP200::parse_packet(segway_packet *packet)
case
0x0402
:
this
->
left_wheel_velocity
=
((
float
)((
short
int
)(((
int
)
packet
->
data
[
9
]
<<
8
)
+
(
int
)
packet
->
data
[
10
])))
*
COUNTS_2_METSEC
;
this
->
right_wheel_velocity
=
((
float
)((
short
int
)(((
int
)
packet
->
data
[
11
]
<<
8
)
+
(
int
)
packet
->
data
[
12
])))
*
COUNTS_2_METSEC
;
this
->
yaw_rate
=
((
float
)((
short
int
)(((
int
)
packet
->
data
[
13
]
<<
8
)
+
(
int
)
packet
->
data
[
14
])))
*
COUNTSDEG_2_RADSEC
;
this
->
servo_fra
me
s
=
((
float
)((
unsigned
short
int
)(((
int
)
packet
->
data
[
15
]
<<
8
)
+
(
int
)
packet
->
data
[
16
])))
*
SEC
FRAMES_2_
FRAME
SEC
;
this
->
upti
me
=
((
float
)((
unsigned
short
int
)(((
int
)
packet
->
data
[
15
]
<<
8
)
+
(
int
)
packet
->
data
[
16
])))
*
FRAMES_2_SEC
;
break
;
case
0x0403
:
this
->
left_wheel_displ
=
((
float
)((
int
)(((
int
)
packet
->
data
[
11
]
<<
24
)
+
((
int
)
packet
->
data
[
12
]
<<
16
)
+
((
int
)
packet
->
data
[
9
]
<<
8
)
+
(
int
)
packet
->
data
[
10
])))
*
COUNTSMETR_2_METR
;
this
->
right_wheel_displ
=
((
float
)((
int
)(((
int
)
packet
->
data
[
15
]
<<
24
)
+
((
int
)
packet
->
data
[
16
]
<<
16
)
+
((
int
)
packet
->
data
[
13
]
<<
8
)
+
(
int
)
packet
->
data
[
14
])))
*
COUNTSMETR_2_METR
;
...
...
@@ -668,7 +668,7 @@ TSegwayRMP200Status CSegwayRMP200::get_status(void)
status
.
right_wheel_displ
=
this
->
right_wheel_displ
;
status
.
forward_displ
=
this
->
forward_displ
;
status
.
yaw_displ
=
this
->
yaw_displ
;
status
.
servo_frames
=
this
->
servo_fra
me
s
;
status
.
uptime
=
this
->
upti
me
;
status
.
left_torque
=
this
->
left_torque
;
status
.
right_torque
=
this
->
right_torque
;
status
.
ui_battery
=
this
->
ui_battery
;
...
...
@@ -716,9 +716,9 @@ float CSegwayRMP200::get_yaw_rate(void)
return
this
->
yaw_rate
;
}
float
CSegwayRMP200
::
get_
servo_fra
me
s
(
void
)
float
CSegwayRMP200
::
get_
upti
me
(
void
)
{
return
this
->
servo_fra
me
s
;
return
this
->
upti
me
;
}
float
CSegwayRMP200
::
get_left_wheel_displacement
(
void
)
...
...
@@ -947,7 +947,7 @@ std::ostream& operator<< (std::ostream& out, CSegwayRMP200& segway)
out
<<
"Left wheel velocity: "
<<
segway
.
left_wheel_velocity
<<
" m/s"
<<
std
::
endl
;
out
<<
"Right wheel velocity: "
<<
segway
.
right_wheel_velocity
<<
" m/s"
<<
std
::
endl
;
out
<<
"Yaw rate: "
<<
segway
.
yaw_rate
*
CSegwayRMP200
::
RADS_2_DEGS
<<
" degrees/s"
<<
std
::
endl
;
out
<<
"
Servo fra
me
s
: "
<<
segway
.
servo_fra
me
s
<<
"
frames/
s"
<<
std
::
endl
;
out
<<
"
Up ti
me: "
<<
segway
.
upti
me
<<
" s"
<<
std
::
endl
;
out
<<
"Left wheel displacement: "
<<
segway
.
left_wheel_displ
<<
" m"
<<
std
::
endl
;
out
<<
"Right wheel displacement: "
<<
segway
.
right_wheel_displ
<<
" m"
<<
std
::
endl
;
out
<<
"Forward displacement: "
<<
segway
.
forward_displ
<<
" m"
<<
std
::
endl
;
...
...
This diff is collapsed.
Click to expand it.
src/segway_rmp200.h
+
15
−
15
View file @
8e10ed89
...
...
@@ -85,7 +85,7 @@ struct TSegwayRMP200Status
float
forward_displ
;
float
yaw_displ
;
// Other configurations
float
servo_fra
me
s
;
float
upti
me
;
float
left_torque
;
float
right_torque
;
float
ui_battery
;
...
...
@@ -187,7 +187,7 @@ class CSegwayRMP200
static
const
float
COUNTSDEG_2_RAD
=
M_PI
/
(
7.8
f
*
180.
f
);
static
const
float
COUNTSDEG_2_RADSEC
=
M_PI
/
(
7.8
f
*
180.
f
);
static
const
float
COUNTS_2_METSEC
=
1.
f
/
332.
f
;
static
const
float
SEC
FRAMES_2_
FRAMESEC
=
1.
f
/
0.01
f
;
static
const
float
FRAMES_2_
SEC
=
0.01
f
;
static
const
float
COUNTSMETR_2_METR
=
1.
f
/
33215.
f
;
static
const
float
COUNTSREV_2_RADS
=
2.
f
*
M_PI
/
112644.
f
;
static
const
float
COUNTSNEWTMETR_2_NEWTMETR
=
1.
f
/
1094.
f
;
...
...
@@ -507,12 +507,12 @@ class CSegwayRMP200
/**
* \brief number of frames per second
*
* This value has the number of se
rvo frames in fames per second. This value is
* periodically updated by the read thread and it is not possible
to modify it
* otherwise. To get its value use the get_
servo_fra
me
s
()
function or the
* overloaded operator <<.
* This value has the number of se
cond since the platform power up. This
*
value is
periodically updated by the read thread and it is not possible
*
to modify it
otherwise. To get its value use the get_
upti
me()
*
function or the
overloaded operator <<.
*/
float
servo_fra
me
s
;
float
upti
me
;
/**
* \brief left wheel displacement
*
...
...
@@ -1218,16 +1218,16 @@ class CSegwayRMP200
*/
float
get_yaw_rate
(
void
);
/**
* \brief function to return the number of se
rvo frames per second
* \brief function to return the number of se
conds since power up
*
* This function returns the current number of se
rvo frames per second. This
* function only returns the value of the internal attribute,
but it does
* not access the hardware platform. This value is periodically
updated by
* the feedback thread.
* This function returns the current number of se
conds the platform has been
*
running. This
function only returns the value of the internal attribute,
*
but it does
not access the hardware platform. This value is periodically
*
updated by
the feedback thread.
*
* \return the current number of se
rvo frames per second
.
* \return the current number of se
conds since power up
.
*/
float
get_
servo_fra
me
s
(
void
);
float
get_
upti
me
(
void
);
/**
* \brief function to return the left wheel displacement
*
...
...
@@ -1452,7 +1452,7 @@ class CSegwayRMP200
* Left wheel velocity: <left_wheel_velocity> m/s
* Right wheel velocity: <right_wheel_velocity> m/s
* Yaw rate: <yaw_rate> radians/s
*
Servo fra
me
s
: <
servo_fra
me
s
>
frames/
s
*
Up ti
me: <
upti
me> s
* Left wheel displacement: <left_wheel_displ> m
* Right wheel displacement: <right_wheel_displ> m
* Forward displacement: <forward_displ> m
...
...
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