Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tsid
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
Stack Of Tasks
tsid
Commits
4dc2cc71
Commit
4dc2cc71
authored
8 months ago
by
rua0ra1
Committed by
Guilhem Saurel
1 week ago
Browse files
Options
Downloads
Patches
Plain Diff
created and implemeted task actuation equality cpp
parent
442d8bef
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bindings/python/tasks/task-actuation-equality.cpp
+28
-0
28 additions, 0 deletions
bindings/python/tasks/task-actuation-equality.cpp
include/tsid/bindings/python/tasks/task-actuation-equality.hpp
+60
-44
60 additions, 44 deletions
...de/tsid/bindings/python/tasks/task-actuation-equality.hpp
with
88 additions
and
44 deletions
bindings/python/tasks/task-actuation-equality.cpp
+
28
−
0
View file @
4dc2cc71
//
// Copyright (c) 2018 CNRS
//
// This file is part of tsid
// tsid is free software: you can redistribute it
// and/or modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation, either version
// 3 of the License, or (at your option) any later version.
// tsid is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Lesser Public License for more details. You should have
// received a copy of the GNU Lesser General Public License along with
// tsid If not, see
// <http://www.gnu.org/licenses/>.
//
#include
"tsid/bindings/python/tasks/task-actuation-equality.hpp"
#include
"tsid/bindings/python/tasks/expose-tasks.hpp"
namespace
tsid
{
namespace
python
{
void
exposeTaskActuationBounds
()
{
TaskActuationEqualityPythonVisitor
<
tsid
::
tasks
::
TaskActuationEquality
>::
expose
(
"TaskActuationEquality"
);
}
}
// namespace python
}
// namespace tsid
This diff is collapsed.
Click to expand it.
include/tsid/bindings/python/tasks/task-actuation-equality.hpp
+
60
−
44
View file @
4dc2cc71
...
...
@@ -30,79 +30,95 @@ struct TaskActuationEqualityPythonVisitor
void
visit
(
PyClass
&
cl
)
const
{
cl
.
def
(
bp
::
init
<
std
::
string
,
robots
::
RobotWrapper
&>
(
(
bp
::
arg
(
"name"
),
bp
::
arg
(
"robot"
)),
"Default Constructor"
))
(
bp
::
arg
(
"name"
),
bp
::
arg
(
"robot"
)),
"Default Constructor"
))
.
add_property
(
"dim"
,
&
TaskAucEq
::
dim
,
"return dimension size"
)
.
def
(
"compute"
,
&
TaskActuationEqualityPythonVisitor
::
compute
,
bp
::
args
(
"t"
,
"q"
,
"v"
,
"data"
))
.
def
(
"getConstraint"
,
&
TaskActuationEqualityPythonVisitor
::
getConstraint
)
.
add_property
(
"mask"
,
bp
::
make_function
(
&
TaskActuationEqualityPythonVisitor
::
getmask
,
bp
::
return_value_policy
<
bp
::
copy_const_reference
>
()),
"Return mask"
)
.
add_property
(
"getReference"
,
bp
::
make_function
(
&
TaskCOMEqualityPythonVisitor
::
getReference
,
bp
::
return_value_policy
<
bp
::
copy_const_reference
>
()))
.
def
(
"setMask"
,
&
TaskActuationEqualityPythonVisitor
::
setmask
,
bp
::
arg
(
"mask"
))
.
def
(
"compute"
,
&
TaskActuationEqualityPythonVisitor
::
compute
,
bp
::
args
(
"t"
,
"q"
,
"v"
,
"data"
))
.
def
(
"getConstraint"
,
&
TaskActuationEqualityPythonVisitor
::
getConstraint
)
.
def
(
"setReference"
,
&
TaskActuationEqualityPythonVisitor
::
setReference
,
bp
::
arg
(
"ref"
))
.
def
(
"getReference"
,
&
TaskActuationEqualityPythonVisitor
::
getReference
)
.
def
(
"setWeightVector"
,
&
TaskActuationEqualityPythonVisitor
::
setWeightVector
,
.
def
(
"setWeightVector"
,
&
TaskActuationEqualityPythonVisitor
::
setWeightVector
,
bp
::
arg
(
"weights"
))
.
def
(
"getWeightVector"
,
&
TaskActuationEqualityPythonVisitor
::
getWeightVector
);
}
.
def
(
"getReference"
,
&
TaskActuationEqualityPythonVisitor
::
getReference
)
.
def
(
"setReference"
,
&
TaskActuationEqualityPythonVisitor
::
setReference
)
static
std
::
string
name
(
TaskAucEq
&
self
)
{
std
::
string
name
=
self
.
name
();
return
name
;
}
static
math
::
ConstraintEquality
compute
(
TaskAucEq
&
self
,
const
double
t
,
const
Eigen
::
VectorXd
&
q
,
const
Eigen
::
VectorXd
&
v
,
pinocchio
::
Data
&
data
)
{
self
.
compute
(
t
,
q
,
v
,
data
);
math
::
ConstraintEquality
cons
(
self
.
getConstraint
().
name
(),
self
.
getConstraint
().
matrix
(),
self
.
getConstraint
().
vector
());
return
cons
;
}
static
math
::
ConstraintEquality
compute
(
TaskAucEq
&
self
,
const
double
t
,
const
Eigen
::
VectorXd
&
q
,
const
Eigen
::
VectorXd
&
v
,
pinocchio
::
Data
&
data
)
{
self
.
compute
(
t
,
q
,
v
,
data
);
math
::
ConstraintEquality
cons
(
self
.
getConstraint
().
name
(),
self
.
getConstraint
().
matrix
(),
self
.
getConstraint
().
vector
());
return
cons
;
}
static
math
::
ConstraintEquality
getConstraint
(
const
TaskAucEq
&
self
)
{
math
::
ConstraintEquality
cons
(
self
.
getConstraint
().
name
(),
self
.
getConstraint
().
matrix
(),
self
.
getConstraint
().
vector
());
return
cons
;
}
static
math
::
ConstraintEquality
getConstraint
(
const
TaskAucEq
&
self
)
{
math
::
ConstraintEquality
cons
(
self
.
getConstraint
().
name
(),
self
.
getConstraint
().
matrix
(),
self
.
getConstraint
().
vector
());
return
cons
;
}
//// getter and setter of reference
static
void
setReference
(
TaskAucEq
&
self
,
const
Eigen
::
VectorXd
&
ref
)
{
self
.
setReference
(
ref
);
}
static
void
setReference
(
TaskAucEq
&
self
,
const
Eigen
::
VectorXd
&
ref
)
{
self
.
setReference
(
ref
);
}
static
const
Eigen
::
VectorXd
&
getReference
(
const
TaskAucEq
&
self
)
{
return
self
.
getReference
();
}
static
const
Eigen
::
VectorXd
&
getReference
(
const
TaskAucEq
&
self
)
{
return
self
.
getReference
();
}
static
void
setWeightVector
(
TaskAucEq
&
self
,
const
Eigen
::
VectorXd
&
ref
)
{
self
.
setReference
(
ref
);
}
// getter and setter of weight
static
const
Eigen
::
VectorXd
&
g
etWeightVector
(
const
TaskAucEq
&
sel
f
)
{
return
self
.
g
et
WeightVector
(
);
}
static
void
s
etWeightVector
(
TaskAucEq
&
self
,
const
Eigen
::
VectorXd
&
re
f
)
{
self
.
s
et
Reference
(
ref
);
}
static
const
Eigen
::
VectorXd
&
getWeightVector
(
const
TaskAucEq
&
self
)
{
return
self
.
getWeightVector
();
}
// getter and setter of mask
static
const
Eigen
::
VectorXd
&
getmask
(
const
TaskAucEq
&
self
)
{
return
self
.
mask
();
}
static
void
setmask
(
TaskAucEq
&
self
,
const
Eigen
::
VectorXd
mask
)
{
return
self
.
mask
(
mask
);
}
static
void
expose
(
const
std
::
string
&
class_name
)
{
std
::
string
doc
=
"TaskActuationEqualityPythonVisitor info."
;
bp
::
class_
<
TaskAucEq
>
(
class_name
.
c_str
(),
doc
.
c_str
(),
bp
::
no_init
)
.
def
(
TaskActuationEqualityPythonVisitor
<
TaskAucEq
>
());
bp
::
register_ptr_to_python
<
boost
::
shared_ptr
<
math
::
ConstraintBase
>
>
();
}
};
...
...
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