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
75d13cdb
Commit
75d13cdb
authored
8 months ago
by
rua0ra1
Committed by
Guilhem Saurel
1 week ago
Browse files
Options
Downloads
Patches
Plain Diff
created binding for all the functions
parent
2f91bd74
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/tsid/bindings/python/tasks/task-actuation-equality.hpp
+80
-29
80 additions, 29 deletions
...de/tsid/bindings/python/tasks/task-actuation-equality.hpp
with
80 additions
and
29 deletions
include/tsid/bindings/python/tasks/task-actuation-equality.hpp
+
80
−
29
View file @
75d13cdb
/*
* Author: Ram Charan Teja Thota
* Date: August 1, 2024
*
*
* Description:
* this file contain boost python binding for task acutation equality
* this file contain boost python binding for task acutation equality
*/
#ifndef __tsid_python_task_actuation_equality_hpp__
#define __tsid_python_task_actuation_equality_hpp__
#include
"tsid/bindings/python/fwd.hpp"
#include
"tsid/tasks/task-actuation-equality.hpp"
#include
"tsid/math/constraint-base.hpp"
#include
"tsid/math/constraint-equality.hpp"
#include
"tsid/robots/robot-wrapper.hpp"
#include
"tsid/tasks/task-actuation-equality.hpp"
#include
"tsid/trajectories/trajectory-base.hpp"
#include
"tsid/math/constraint-equality.hpp"
#include
"tsid/math/constraint-base.hpp"
namespace
tsid
{
namespace
tsid
{
namespace
python
{
namespace
bp
=
boost
::
python
;
namespace
python
{
namespace
bp
=
boost
::
python
;
template
<
typename
Task
>
template
<
typename
Task
AucEq
>
struct
TaskActuationEqualityPythonVisitor
:
public
boost
::
python
::
def_visitor
<
TaskActuationEqualityPythonVisitor
<
Task
>>
{
template
<
class
PyClass
>
void
visit
(
PyClass
&
cl
)
const
{
cl
.
def
(
bp
::
init
<
std
::
string
,
robots
::
RobotWrapper
&>
(
(
bp
::
arg
(
"name"
)),
bp
::
arg
(
"robot"
)),
"Default Constructor"
)
.
add_property
(
"dim"
,
&
Task
::
dim
,
"return dimension size"
)
.
add_property
(
"mask"
,
:
public
boost
::
python
::
def_visitor
<
TaskActuationEqualityPythonVisitor
<
TaskAucEq
>>
{
template
<
class
PyClass
>
void
visit
(
PyClass
&
cl
)
const
{
cl
.
def
(
bp
::
init
<
std
::
string
,
robots
::
RobotWrapper
&>
(
(
bp
::
arg
(
"name"
),
bp
::
arg
(
"robot"
)),
"Default Constructor"
))
.
add_property
(
"dim"
,
&
TaskAucEq
::
dim
,
"return dimension size"
)
.
add_property
(
"mask"
,
bp
::
make_function
(
&
TaskActuationEqualityPythonVisitor
::
getmask
,
bp
::
return_value_policy
<
bp
::
copy_const_reference
>
()),
"Return mask"
)
.
def
(
"setMask"
,
&
TaskActuationEqualityPythonVisitor
::
setmask
,
.
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
,
.
def
(
"compute"
,
&
TaskActuationEqualityPythonVisitor
::
compute
,
bp
::
args
(
"t"
,
"q"
,
"v"
,
"data"
))
.
def
}
};
.
def
(
"getConstraint"
,
&
TaskActuationEqualityPythonVisitor
::
getConstraint
)
.
def
(
"setReference"
,
&
TaskActuationEqualityPythonVisitor
::
setReference
,
bp
::
arg
(
"ref"
))
.
def
(
"setWeightVector"
,
&
TaskActuationEqualityPythonVisitor
::
setWeightVector
,
bp
::
arg
(
"weights"
))
.
def
(
"getReference"
,
&
TaskActuationEqualityPythonVisitor
::
getReference
)
.
def
(
"setReference"
,
&
TaskActuationEqualityPythonVisitor
::
setReference
)
}
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
void
setReference
(
TaskAucEq
&
self
,
const
Eigen
::
VectorXd
&
ref
)
{
self
.
setReference
(
ref
);
}
static
const
Eigen
::
VectorXd
&
getReference
(
const
TaskAucEq
&
self
)
{
return
self
.
getReference
();
}
static
void
setWeightVector
(
TaskAucEq
&
self
,
const
Eigen
::
VectorXd
&
ref
)
{
self
.
setReference
(
ref
);
}
static
const
Eigen
::
VectorXd
&
getWeightVector
(
const
TaskAucEq
&
self
)
{
return
self
.
getWeightVector
();
}
}
//namespace python
}
//namespace tsid
};
}
// namespace python
}
// namespace tsid
#endif // ifndef __tsid_python_task_actuation_equality_hpp__
\ No newline at end of file
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