Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
darwin_robot_driver
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
darwin
darwin_robot_driver
Commits
302357b7
Commit
302357b7
authored
8 years ago
by
Sergi Hernandez
Browse files
Options
Downloads
Patches
Plain Diff
Removed the walk status attribute.
Solved a bug in the codification of some of the walk parameters.
parent
b0608740
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/darwin_robot.cpp
+10
-17
10 additions, 17 deletions
src/darwin_robot.cpp
src/darwin_robot.h
+1
-3
1 addition, 3 deletions
src/darwin_robot.h
with
11 additions
and
20 deletions
src/darwin_robot.cpp
+
10
−
17
View file @
302357b7
...
...
@@ -80,8 +80,6 @@ CDarwinRobot::CDarwinRobot(const std::string &name,std::string &bus_id,int bus_s
this
->
robot_device
->
read_byte_register
(
DARWIN_MM_NUM_SERVOS
,
&
this
->
manager_num_servos
);
/* get the current action status */
this
->
robot_device
->
read_byte_register
(
DARWIN_ACTION_CNTRL
,
&
this
->
action_status
);
/* get the current walking status */
this
->
robot_device
->
read_byte_register
(
DARWIN_WALK_CNTRL
,
&
this
->
walk_status
);
/* get the current joints status */
for
(
i
=
0
;
i
<
JOINTS_NUM_GROUPS
;
i
++
)
this
->
robot_device
->
read_byte_register
(
DARWIN_JOINT_GRP0_CNTRL
+
i
*
5
,
&
this
->
joints_status
[
i
]);
...
...
@@ -956,7 +954,7 @@ double CDarwinRobot::walk_get_x_offset(void)
if
(
this
->
robot_device
!=
NULL
)
{
this
->
robot_device
->
read_byte_register
(
DARWIN_WALK_X_OFFSET
,
&
offset
);
return
((
double
)
offset
)
/
1000.0
;
return
((
double
)
((
signed
char
)
offset
)
)
/
1000.0
;
}
else
throw
CDarwinRobotException
(
_HERE_
,
"Invalid robot device"
);
...
...
@@ -982,7 +980,7 @@ double CDarwinRobot::walk_get_y_offset(void)
if
(
this
->
robot_device
!=
NULL
)
{
this
->
robot_device
->
read_byte_register
(
DARWIN_WALK_Y_OFFSET
,
&
offset
);
return
((
double
)
offset
)
/
1000.0
;
return
((
double
)
((
signed
char
)
offset
)
)
/
1000.0
;
}
else
throw
CDarwinRobotException
(
_HERE_
,
"Invalid robot device"
);
...
...
@@ -1008,7 +1006,7 @@ double CDarwinRobot::walk_get_z_offset(void)
if
(
this
->
robot_device
!=
NULL
)
{
this
->
robot_device
->
read_byte_register
(
DARWIN_WALK_Z_OFFSET
,
&
offset
);
return
((
double
)
offset
)
/
1000.0
;
return
((
double
)
((
signed
char
)
offset
)
)
/
1000.0
;
}
else
throw
CDarwinRobotException
(
_HERE_
,
"Invalid robot device"
);
...
...
@@ -1098,7 +1096,7 @@ void CDarwinRobot::walk_set_hip_pitch_offset(double offset_rad)
if
(
this
->
robot_device
!=
NULL
)
{
offset
=
(
unsigned
short
int
)((
offset_rad
*
180.0
/
PI
)
*
8
.0
);
offset
=
(
unsigned
short
int
)((
offset_rad
*
180.0
/
PI
)
*
1024
.0
);
this
->
robot_device
->
write_word_register
(
DARWIN_WALK_HIP_PITCH_OFF_L
,
offset
);
}
else
...
...
@@ -1112,7 +1110,7 @@ double CDarwinRobot::walk_get_hip_pitch_offset(void)
if
(
this
->
robot_device
!=
NULL
)
{
this
->
robot_device
->
read_word_register
(
DARWIN_WALK_HIP_PITCH_OFF_L
,
&
offset
);
return
(((
double
)
offset
)
*
PI
/
180.0
)
/
8
.0
;
return
(((
double
)
offset
)
*
PI
/
180.0
)
/
1024
.0
;
}
else
throw
CDarwinRobotException
(
_HERE_
,
"Invalid robot device"
);
...
...
@@ -1124,7 +1122,8 @@ void CDarwinRobot::walk_set_period(double period_s)
if
(
this
->
robot_device
!=
NULL
)
{
period
=
(
unsigned
char
)(
period_s
*
1000.0
);
period
=
(
unsigned
short
int
)(
period_s
*
1000.0
);
std
::
cout
<<
period_s
<<
","
<<
period
<<
std
::
endl
;
this
->
robot_device
->
write_word_register
(
DARWIN_WALK_PERIOD_TIME_L
,
period
);
}
else
...
...
@@ -1320,7 +1319,7 @@ double CDarwinRobot::walk_get_arm_swing_gain(void)
if
(
this
->
robot_device
!=
NULL
)
{
this
->
robot_device
->
read_byte_register
(
DARWIN_WALK_ARM_SWING_GAIN
,
&
gain_int
);
return
((
double
)
gain_int
)
*
32.0
;
return
((
double
)
gain_int
)
/
32.0
;
}
else
throw
CDarwinRobotException
(
_HERE_
,
"Invalid robot device"
);
...
...
@@ -1381,10 +1380,7 @@ double CDarwinRobot::walk_get_rot_speed(void)
void
CDarwinRobot
::
walk_start
(
void
)
{
if
(
this
->
robot_device
!=
NULL
)
{
this
->
walk_status
|=
WALK_START
;
this
->
robot_device
->
write_byte_register
(
DARWIN_WALK_CNTRL
,
this
->
walk_status
);
}
this
->
robot_device
->
write_byte_register
(
DARWIN_WALK_CNTRL
,
WALK_START
);
else
throw
CDarwinRobotException
(
_HERE_
,
"Invalid robot device"
);
}
...
...
@@ -1392,10 +1388,7 @@ void CDarwinRobot::walk_start(void)
void
CDarwinRobot
::
walk_stop
(
void
)
{
if
(
this
->
robot_device
!=
NULL
)
{
this
->
walk_status
|=
WALK_STOP
;
this
->
robot_device
->
write_byte_register
(
DARWIN_WALK_CNTRL
,
this
->
walk_status
);
}
this
->
robot_device
->
write_byte_register
(
DARWIN_WALK_CNTRL
,
WALK_STOP
);
else
throw
CDarwinRobotException
(
_HERE_
,
"Invalid robot device"
);
}
...
...
This diff is collapsed.
Click to expand it.
src/darwin_robot.h
+
1
−
3
View file @
302357b7
...
...
@@ -52,8 +52,6 @@ class CDarwinRobot
unsigned
char
manager_status
;
/* action status */
unsigned
char
action_status
;
/* walk status */
unsigned
char
walk_status
;
/* joint group status */
unsigned
char
joints_status
[
JOINTS_NUM_GROUPS
];
/* head tracking status */
...
...
@@ -137,7 +135,7 @@ class CDarwinRobot
double
walk_get_yaw_offset
(
void
);
void
walk_set_hip_pitch_offset
(
double
offset_rad
);
double
walk_get_hip_pitch_offset
(
void
);
void
walk_set_period
(
double
period_
m
s
);
void
walk_set_period
(
double
period_s
);
double
walk_get_period
(
void
);
void
walk_set_ssp_dsp_ratio
(
double
ratio
);
double
walk_get_ssp_dsp_ratio
(
void
);
...
...
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