Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
tsid
Commits
85d22a6a
Commit
85d22a6a
authored
Mar 10, 2021
by
Andrea Del Prete
Browse files
[c++] Add method to set contact normal in TaskCop
parent
0431e664
Pipeline
#13417
passed with stage
in 35 minutes and 13 seconds
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
include/tsid/bindings/python/tasks/task-cop-equality.hpp
View file @
85d22a6a
...
@@ -49,6 +49,7 @@ namespace tsid
...
@@ -49,6 +49,7 @@ namespace tsid
.
def
(
bp
::
init
<
std
::
string
,
robots
::
RobotWrapper
&>
((
bp
::
arg
(
"name"
),
bp
::
arg
(
"robot"
)),
"Default Constructor"
))
.
def
(
bp
::
init
<
std
::
string
,
robots
::
RobotWrapper
&>
((
bp
::
arg
(
"name"
),
bp
::
arg
(
"robot"
)),
"Default Constructor"
))
.
add_property
(
"dim"
,
&
TaskCOP
::
dim
,
"return dimension size"
)
.
add_property
(
"dim"
,
&
TaskCOP
::
dim
,
"return dimension size"
)
.
def
(
"setReference"
,
&
TaskCOPEqualityPythonVisitor
::
setReference
,
bp
::
arg
(
"ref"
))
.
def
(
"setReference"
,
&
TaskCOPEqualityPythonVisitor
::
setReference
,
bp
::
arg
(
"ref"
))
.
def
(
"setContactNormal"
,
&
TaskCOPEqualityPythonVisitor
::
setContactNormal
,
bp
::
arg
(
"normal"
))
.
def
(
"compute"
,
&
TaskCOPEqualityPythonVisitor
::
compute
,
bp
::
args
(
"t"
,
"q"
,
"v"
,
"data"
))
.
def
(
"compute"
,
&
TaskCOPEqualityPythonVisitor
::
compute
,
bp
::
args
(
"t"
,
"q"
,
"v"
,
"data"
))
.
def
(
"getConstraint"
,
&
TaskCOPEqualityPythonVisitor
::
getConstraint
)
.
def
(
"getConstraint"
,
&
TaskCOPEqualityPythonVisitor
::
getConstraint
)
.
add_property
(
"name"
,
&
TaskCOPEqualityPythonVisitor
::
name
)
.
add_property
(
"name"
,
&
TaskCOPEqualityPythonVisitor
::
name
)
...
@@ -70,6 +71,9 @@ namespace tsid
...
@@ -70,6 +71,9 @@ namespace tsid
static
void
setReference
(
TaskCOP
&
self
,
const
Eigen
::
Vector3d
&
ref
){
static
void
setReference
(
TaskCOP
&
self
,
const
Eigen
::
Vector3d
&
ref
){
self
.
setReference
(
ref
);
self
.
setReference
(
ref
);
}
}
static
void
setContactNormal
(
TaskCOP
&
self
,
const
Eigen
::
Vector3d
&
n
){
self
.
setContactNormal
(
n
);
}
static
void
expose
(
const
std
::
string
&
class_name
)
static
void
expose
(
const
std
::
string
&
class_name
)
{
{
std
::
string
doc
=
"TaskCOPEqualityPythonVisitor info."
;
std
::
string
doc
=
"TaskCOPEqualityPythonVisitor info."
;
...
@@ -77,8 +81,6 @@ namespace tsid
...
@@ -77,8 +81,6 @@ namespace tsid
doc
.
c_str
(),
doc
.
c_str
(),
bp
::
no_init
)
bp
::
no_init
)
.
def
(
TaskCOPEqualityPythonVisitor
<
TaskCOP
>
());
.
def
(
TaskCOPEqualityPythonVisitor
<
TaskCOP
>
());
// bp::register_ptr_to_python< boost::shared_ptr<math::ConstraintBase> >();
}
}
};
};
}
}
...
...
include/tsid/tasks/task-cop-equality.hpp
View file @
85d22a6a
...
@@ -66,6 +66,9 @@ namespace tsid
...
@@ -66,6 +66,9 @@ namespace tsid
void
setReference
(
const
Vector3
&
ref
);
void
setReference
(
const
Vector3
&
ref
);
const
Vector3
&
getReference
()
const
;
const
Vector3
&
getReference
()
const
;
void
setContactNormal
(
const
Vector3
&
n
);
const
Vector3
&
getContactNormal
()
const
;
protected:
protected:
const
std
::
vector
<
std
::
shared_ptr
<
ContactLevel
>
>
*
m_contacts
;
const
std
::
vector
<
std
::
shared_ptr
<
ContactLevel
>
>
*
m_contacts
;
std
::
string
m_contact_name
;
// an empty string
std
::
string
m_contact_name
;
// an empty string
...
...
src/tasks/task-com-equality.cpp
View file @
85d22a6a
...
@@ -58,7 +58,7 @@ namespace tsid
...
@@ -58,7 +58,7 @@ namespace tsid
int
TaskComEquality
::
dim
()
const
int
TaskComEquality
::
dim
()
const
{
{
return
m_mask
.
sum
();
return
int
(
m_mask
.
sum
()
)
;
}
}
const
Vector3
&
TaskComEquality
::
Kp
(){
return
m_Kp
;
}
const
Vector3
&
TaskComEquality
::
Kp
(){
return
m_Kp
;
}
...
...
src/tasks/task-cop-equality.cpp
View file @
85d22a6a
...
@@ -110,5 +110,15 @@ const Vector3 & TaskCopEquality::getReference() const
...
@@ -110,5 +110,15 @@ const Vector3 & TaskCopEquality::getReference() const
return
m_ref
;
return
m_ref
;
}
}
void
TaskCopEquality
::
setContactNormal
(
const
Vector3
&
n
)
{
m_normal
=
n
;
}
const
Vector3
&
TaskCopEquality
::
getContactNormal
()
const
{
return
m_normal
;
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment