Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Simox
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
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Leander Singer
Simox
Commits
d2daea40
Commit
d2daea40
authored
2 years ago
by
Rainer Kartmann
Browse files
Options
Downloads
Patches
Plain Diff
Fix content of assertions in RobotNodeFourBar
parent
2badb002
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
VirtualRobot/Nodes/RobotNodeFourBar.cpp
+14
-14
14 additions, 14 deletions
VirtualRobot/Nodes/RobotNodeFourBar.cpp
with
14 additions
and
14 deletions
VirtualRobot/Nodes/RobotNodeFourBar.cpp
+
14
−
14
View file @
d2daea40
...
...
@@ -176,7 +176,7 @@ namespace VirtualRobot
{
this
->
xmlInfo
=
info
;
VR_ASSERT
(
second
.
has_value
());
VR_ASSERT
(
active
.
has_value
());
switch
(
info
.
role
)
{
case
Role
::
PASSIVE
:
...
...
@@ -199,16 +199,16 @@ namespace VirtualRobot
bool
RobotNodeFourBar
::
initialize
(
SceneObjectPtr
parent
,
const
std
::
vector
<
SceneObjectPtr
>&
children
)
{
VR_ASSERT_MESSAGE
(
first
.
has_value
()
xor
second
.
has_value
(),
std
::
stringstream
()
<<
first
.
has_value
()
<<
" / "
<<
second
.
has_value
());
VR_ASSERT_MESSAGE
(
first
.
has_value
()
xor
active
.
has_value
(),
std
::
stringstream
()
<<
first
.
has_value
()
<<
" / "
<<
active
.
has_value
());
// The
second
node needs to store a reference to the first node.
// The
active
node needs to store a reference to the first node.
// Whenever the joint value has changed, the passive joint will be updated.
if
(
active
)
{
std
::
cout
<<
"Initializing active four bar joint"
<<
std
::
endl
;
VR_ASSERT_MESSAGE
(
not
second
->
first
,
"Second must not be initialized yet."
);
VR_ASSERT_MESSAGE
(
not
active
->
passive
,
"Second must not be initialized yet."
);
VirtualRobot
::
SceneObjectPtr
currentParent
=
parent
;
...
...
@@ -281,8 +281,8 @@ namespace VirtualRobot
void
RobotNodeFourBar
::
updateTransformationMatrices
(
const
Eigen
::
Matrix4f
&
parentPose
)
{
VR_ASSERT_MESSAGE
(
first
.
has_value
()
xor
second
.
has_value
(),
std
::
stringstream
()
<<
first
.
has_value
()
<<
" / "
<<
second
.
has_value
());
VR_ASSERT_MESSAGE
(
first
.
has_value
()
xor
active
.
has_value
(),
std
::
stringstream
()
<<
first
.
has_value
()
<<
" / "
<<
active
.
has_value
());
std
::
cout
<<
"Updating RobotNodeFourBar::updateTransformationMatrices"
<<
std
::
endl
;
...
...
@@ -316,7 +316,7 @@ namespace VirtualRobot
// }
// else if (active)
// {
// VR_ASSERT_MESSAGE(
second
->first, "First node must be known to
second
node.");
// VR_ASSERT_MESSAGE(
active
->first, "First node must be known to
active
node.");
// JointMath& math = active->math();
// Eigen::Vector2f actuators(active->passive->getJointValue(), this->getJointValue());
...
...
@@ -333,7 +333,7 @@ namespace VirtualRobot
// Eigen::IOFormat iof(5, 0, " ", "\n", " [", "]");
// std::cout
// << __FUNCTION__ << "() of
second
actuator with "
// << __FUNCTION__ << "() of
active
actuator with "
// << "\n lever = " << math.joint.lever << "\n theta0 = " << math.joint.theta0
// << "\n radius = " << math.joint.radius << "\n joint value = " << jointValue
// << "\n actuator (angle) = \n"
...
...
@@ -351,8 +351,8 @@ namespace VirtualRobot
RobotNodeFourBar
::
print
(
bool
printChildren
,
bool
printDecoration
)
const
{
ReadLockPtr
lock
=
getRobot
()
->
getReadLock
();
VR_ASSERT_MESSAGE
(
first
.
has_value
()
xor
second
.
has_value
(),
std
::
stringstream
()
<<
first
.
has_value
()
<<
" / "
<<
second
.
has_value
());
VR_ASSERT_MESSAGE
(
first
.
has_value
()
xor
active
.
has_value
(),
std
::
stringstream
()
<<
first
.
has_value
()
<<
" / "
<<
active
.
has_value
());
if
(
printDecoration
)
{
...
...
@@ -367,7 +367,7 @@ namespace VirtualRobot
}
else
if
(
active
)
{
std
::
cout
<<
"* four_bar joint
second
node"
;
std
::
cout
<<
"* four_bar joint
active
node"
;
// std::cout << "* Transform: \n"
// << active->math.joint.getEndEffectorTransform() << std::endl;
}
...
...
@@ -519,8 +519,8 @@ namespace VirtualRobot
std
::
string
RobotNodeFourBar
::
_toXML
(
const
std
::
string
&
/*modelPath*/
)
{
VR_ASSERT_MESSAGE
(
first
.
has_value
()
xor
second
.
has_value
(),
std
::
stringstream
()
<<
first
.
has_value
()
<<
" / "
<<
second
.
has_value
());
VR_ASSERT_MESSAGE
(
first
.
has_value
()
xor
active
.
has_value
(),
std
::
stringstream
()
<<
first
.
has_value
()
<<
" / "
<<
active
.
has_value
());
if
(
first
)
{
...
...
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