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
Container Registry
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software
Simox
Simox
Commits
eb52518b
Commit
eb52518b
authored
3 years ago
by
Fabian Reister
Browse files
Options
Downloads
Patches
Plain Diff
snapshot
parent
0a5c9637
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!82
Feature/robot placement paper
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
VirtualRobot/Workspace/WorkspaceGrid.cpp
+16
-9
16 additions, 9 deletions
VirtualRobot/Workspace/WorkspaceGrid.cpp
VirtualRobot/Workspace/WorkspaceRepresentation.cpp
+3
-3
3 additions, 3 deletions
VirtualRobot/Workspace/WorkspaceRepresentation.cpp
with
19 additions
and
12 deletions
VirtualRobot/Workspace/WorkspaceGrid.cpp
+
16
−
9
View file @
eb52518b
...
...
@@ -474,13 +474,15 @@ namespace VirtualRobot
return
fillGridData
(
ws
,
graspGlobal
,
g
,
baseRobotNode
,
baseOrientation
,
maxAngle
);
}
bool
WorkspaceGrid
::
fillGridData
(
WorkspaceRepresentationPtr
ws
,
const
Eigen
::
Matrix4f
&
global_T_grasp
,
GraspPtr
g
,
RobotNodePtr
baseRobotNode
,
float
baseOrientation
,
const
float
maxAngle
)
bool
WorkspaceGrid
::
fillGridData
(
WorkspaceRepresentationPtr
ws
,
const
Eigen
::
Matrix4f
&
global_T_grasp
_orig
,
GraspPtr
g
,
RobotNodePtr
baseRobotNode
,
float
baseOrientation
,
const
float
maxAngle
)
{
if
(
!
ws
)
{
return
false
;
}
// baseOrientation = 0;
// ensure robot is at identity
Eigen
::
Matrix4f
gpOrig
=
Eigen
::
Matrix4f
::
Identity
();
...
...
@@ -491,19 +493,24 @@ namespace VirtualRobot
baseRobotNode
->
getRobot
()
->
setGlobalPose
(
Eigen
::
Matrix4f
::
Identity
());
}
const
Eigen
::
AngleAxisf
global_R_robot_inv
(
-
baseOrientation
,
Eigen
::
Vector3f
::
UnitZ
());
const
Eigen
::
AngleAxisf
global_R_robot
(
baseOrientation
,
Eigen
::
Vector3f
::
UnitZ
());
// const Eigen::AngleAxisf global_R_robot_inv(baseOrientation, Eigen::Vector3f::UnitZ());
// const Eigen::AngleAxisf global_R_robot(-baseOrientation, Eigen::Vector3f::UnitZ());
Eigen
::
Isometry3f
global_T_grasp
(
global_T_grasp_orig
);
global_T_grasp
.
linear
()
=
Eigen
::
AngleAxisf
(
-
baseOrientation
,
Eigen
::
Vector3f
::
UnitZ
())
*
global_T_grasp
.
linear
();
Eigen
::
Isometry3f
robot_T_grasp
(
global_T_grasp
);
robot_T_grasp
.
linear
()
=
global_R_robot_inv
.
toRotationMatrix
()
*
robot_T_grasp
.
linear
();
//
Eigen::Isometry3f robot_T_grasp(global_T_grasp);
//
robot_T_grasp.linear() = global_R_robot_inv.toRotationMatrix() * robot_T_grasp.linear();
Eigen
::
Isometry3f
robot_T_grasp2
(
global_T_grasp
);
robot_T_grasp2
.
linear
()
=
global_R_robot
.
toRotationMatrix
()
*
robot_T_grasp2
.
linear
();
//
Eigen::Isometry3f robot_T_grasp2(global_T_grasp);
//
robot_T_grasp2.linear() = global_R_robot.toRotationMatrix() * robot_T_grasp2.linear();
WorkspaceRepresentation
::
WorkspaceCut2DPtr
cutXY
=
ws
->
createCut
(
robot
_T_grasp
.
matrix
(),
discretizeSize
,
false
);
WorkspaceRepresentation
::
WorkspaceCut2DPtr
cutXY
=
ws
->
createCut
(
global
_T_grasp
.
matrix
(),
discretizeSize
,
false
);
// VR_INFO << "Reference global pose" << cutXY->referenceGlobalPose;
cutXY
->
referenceGlobalPose
=
(
global_R_robot
_inv
*
Eigen
::
Isometry3f
(
global_T_grasp
)).
matrix
();
//
cutXY->referenceGlobalPose = (global_R_robot * Eigen::Isometry3f(global_T_grasp)).matrix();
std
::
vector
<
WorkspaceRepresentation
::
WorkspaceCut2DTransformationPtr
>
transformations
=
ws
->
createCutTransformations
(
cutXY
,
baseRobotNode
,
M_PI
/*, isFlipped*/
);
setEntries
(
transformations
,
global_T_grasp
.
matrix
(),
g
);
...
...
This diff is collapsed.
Click to expand it.
VirtualRobot/Workspace/WorkspaceRepresentation.cpp
+
3
−
3
View file @
eb52518b
...
...
@@ -1875,10 +1875,10 @@ namespace VirtualRobot
float
yaw
=
std
::
atan2
(
pose
.
translation
().
y
(),
pose
.
translation
().
x
())
-
M_PI_2f32
;
yaw
=
simox
::
math
::
periodic_clamp
(
yaw
,
-
M_PIf32
,
M_PIf32
);
if
(
yaw
<
maxAngle
and
yaw
>
-
maxAngle
)
{
//
if (yaw < maxAngle and yaw > -maxAngle)
//
{
result
.
push_back
(
tp
);
}
//
}
}
}
}
...
...
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