Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Q
quadruped-reactive-walking
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
Gepetto
quadruped-reactive-walking
Commits
f3497f6e
Commit
f3497f6e
authored
2 years ago
by
Pierre-Alexandre Leziart
Browse files
Options
Downloads
Patches
Plain Diff
Add set functions for past and desired gait
parent
581a6cff
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/qrw/Gait.hpp
+18
-0
18 additions, 0 deletions
include/qrw/Gait.hpp
python/Gait.cpp
+5
-0
5 additions, 0 deletions
python/Gait.cpp
src/Gait.cpp
+23
-1
23 additions, 1 deletion
src/Gait.cpp
with
46 additions
and
1 deletion
include/qrw/Gait.hpp
+
18
−
0
View file @
f3497f6e
...
@@ -136,6 +136,24 @@ class Gait {
...
@@ -136,6 +136,24 @@ class Gait {
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
void
setCurrentGait
(
MatrixN4
const
&
gaitMatrix
);
void
setCurrentGait
(
MatrixN4
const
&
gaitMatrix
);
////////////////////////////////////////////////////////////////////////////////////////////////
///
/// \brief Update the past gait matrix externally (directly set the gait matrix)
///
/// \param[in] gaitMatrix Gait matrix that should be used for the past gait matrix
///
////////////////////////////////////////////////////////////////////////////////////////////////
void
setPastGait
(
MatrixN4
const
&
gaitMatrix
);
////////////////////////////////////////////////////////////////////////////////////////////////
///
/// \brief Update the desired gait matrix externally (directly set the gait matrix)
///
/// \param[in] gaitMatrix Gait matrix that should be used for the desired gait matrix
///
////////////////////////////////////////////////////////////////////////////////////////////////
void
setDesiredGait
(
MatrixN4
const
&
gaitMatrix
);
MatrixN4
getPastGait
()
{
return
pastGait_
;
}
MatrixN4
getPastGait
()
{
return
pastGait_
;
}
MatrixN4
getCurrentGait
()
{
return
currentGait_
;
}
MatrixN4
getCurrentGait
()
{
return
currentGait_
;
}
double
getCurrentGaitCoeff
(
int
i
,
int
j
)
{
return
currentGait_
(
i
,
j
);
}
double
getCurrentGaitCoeff
(
int
i
,
int
j
)
{
return
currentGait_
(
i
,
j
);
}
...
...
This diff is collapsed.
Click to expand it.
python/Gait.cpp
+
5
−
0
View file @
f3497f6e
...
@@ -29,6 +29,11 @@ struct GaitVisitor : public bp::def_visitor<GaitVisitor<Gait>> {
...
@@ -29,6 +29,11 @@ struct GaitVisitor : public bp::def_visitor<GaitVisitor<Gait>> {
.
def
(
"set_current_gait"
,
&
Gait
::
setCurrentGait
,
bp
::
args
(
"gaitMatrix"
),
.
def
(
"set_current_gait"
,
&
Gait
::
setCurrentGait
,
bp
::
args
(
"gaitMatrix"
),
"Set current gait matrix from Python.
\n
"
)
"Set current gait matrix from Python.
\n
"
)
.
def
(
"set_past_gait"
,
&
Gait
::
setPastGait
,
bp
::
args
(
"gaitMatrix"
),
"Set past gait matrix from Python.
\n
"
)
.
def
(
"set_desired_gait"
,
&
Gait
::
setDesiredGait
,
bp
::
args
(
"gaitMatrix"
),
"Set desired gait matrix from Python.
\n
"
)
.
add_property
(
"matrix"
,
.
add_property
(
"matrix"
,
bp
::
make_function
(
&
Gait
::
getCurrentGait
,
bp
::
return_value_policy
<
bp
::
return_by_value
>
()));
bp
::
make_function
(
&
Gait
::
getCurrentGait
,
bp
::
return_value_policy
<
bp
::
return_by_value
>
()));
}
}
...
...
This diff is collapsed.
Click to expand it.
src/Gait.cpp
+
23
−
1
View file @
f3497f6e
...
@@ -231,4 +231,26 @@ void Gait::setCurrentGait(MatrixN4 const& gaitMatrix) {
...
@@ -231,4 +231,26 @@ void Gait::setCurrentGait(MatrixN4 const& gaitMatrix) {
}
}
currentGait_
=
gaitMatrix
;
currentGait_
=
gaitMatrix
;
}
}
\ No newline at end of file
void
Gait
::
setPastGait
(
MatrixN4
const
&
gaitMatrix
)
{
if
(
gaitMatrix
.
rows
()
!=
pastGait_
.
rows
())
{
throw
std
::
runtime_error
(
"Input matrix should have the same number of rows than the past gait matrix."
);
}
if
(
gaitMatrix
.
cols
()
!=
pastGait_
.
cols
())
{
throw
std
::
runtime_error
(
"Input matrix should have the same number of columns than the past gait matrix."
);
}
pastGait_
=
gaitMatrix
;
}
void
Gait
::
setDesiredGait
(
MatrixN4
const
&
gaitMatrix
)
{
if
(
gaitMatrix
.
rows
()
!=
desiredGait_
.
rows
())
{
throw
std
::
runtime_error
(
"Input matrix should have the same number of rows than the desired gait matrix."
);
}
if
(
gaitMatrix
.
cols
()
!=
desiredGait_
.
cols
())
{
throw
std
::
runtime_error
(
"Input matrix should have the same number of columns than the desired gait matrix."
);
}
desiredGait_
=
gaitMatrix
;
}
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