Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
trick_or_treat
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
Service Desk
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
socrates_ws
trick_or_treat
Commits
28dd679a
Commit
28dd679a
authored
7 years ago
by
Antonio Andriella
Browse files
Options
Downloads
Patches
Plain Diff
removing debugging
parent
6c2e7659
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
iri_trick_or_treat/src/trick_or_treat_alg_node.cpp
+231
-7
231 additions, 7 deletions
iri_trick_or_treat/src/trick_or_treat_alg_node.cpp
with
231 additions
and
7 deletions
iri_trick_or_treat/src/trick_or_treat_alg_node.cpp
+
231
−
7
View file @
28dd679a
...
...
@@ -83,7 +83,7 @@ void TrickOrTreatAlgNode::mainNodeThread(void)
{
case
0
:
{
//initialize the pick location
//initialize the pick
and place
location
int
pick_location
=
1
;
int
place_location
=
8
;
...
...
@@ -92,12 +92,9 @@ void TrickOrTreatAlgNode::mainNodeThread(void)
double
pick_grasp_block_z_ax
=
-
0.02
;
double
pick_pregrasp_block_z_ax
=
0.1
;
double
pick_postgrasp_block_z_ax
=
0.2
;
double
place_grasp_block_z_ax
=
0.2
;
double
place_pregrasp_block_z_ax
=
0.1
;
double
place_postgrasp_block_z_ax
=
0.25
;
ROS_INFO
(
"1"
);
tfTransformation2BoardFrame
(
pick_location
,
board_frame
,
...
...
@@ -105,9 +102,7 @@ void TrickOrTreatAlgNode::mainNodeThread(void)
pick_grasp_block_z_ax
,
pick_pregrasp_block_z_ax
,
pick_postgrasp_block_z_ax
);
ROS_INFO
(
"2"
);
pickOrPlaceBlock
(
pregrasp_point
,
grasp_point
,
postgrasp_point
,
ini_grasp_EF_rpy
,
end_grasp_EF_rpy
,
1
,
true
);
ROS_INFO
(
"3"
);
tfTransformation2BoardFrame
(
place_location
,
board_frame
,
...
...
@@ -115,7 +110,6 @@ void TrickOrTreatAlgNode::mainNodeThread(void)
place_grasp_block_z_ax
,
place_pregrasp_block_z_ax
,
place_postgrasp_block_z_ax
);
ROS_INFO
(
"4"
);
//wait for the action to return
bool
finished_before_timeout
=
pick_or_place_client_
.
waitForResult
(
ros
::
Duration
(
50.0
));
...
...
@@ -137,14 +131,244 @@ void TrickOrTreatAlgNode::mainNodeThread(void)
break
;
case
1
:
{
//initialize the pick and place location
int
pick_location
=
1
;
int
place_location
=
8
;
geometry_msgs
::
PoseStamped
board_frame
;
geometry_msgs
::
PoseStamped
iri_wam_link_base_frame
;
double
pick_grasp_block_z_ax
=
-
0.02
;
double
pick_pregrasp_block_z_ax
=
0.1
;
double
pick_postgrasp_block_z_ax
=
0.2
;
double
place_grasp_block_z_ax
=
0.2
;
double
place_pregrasp_block_z_ax
=
0.1
;
double
place_postgrasp_block_z_ax
=
0.25
;
tfTransformation2BoardFrame
(
pick_location
,
board_frame
,
iri_wam_link_base_frame
,
pick_grasp_block_z_ax
,
pick_pregrasp_block_z_ax
,
pick_postgrasp_block_z_ax
);
pickOrPlaceBlock
(
pregrasp_point
,
grasp_point
,
postgrasp_point
,
ini_grasp_EF_rpy
,
end_grasp_EF_rpy
,
1
,
true
);
tfTransformation2BoardFrame
(
place_location
,
board_frame
,
iri_wam_link_base_frame
,
place_grasp_block_z_ax
,
place_pregrasp_block_z_ax
,
place_postgrasp_block_z_ax
);
//wait for the action to return
bool
finished_before_timeout
=
pick_or_place_client_
.
waitForResult
(
ros
::
Duration
(
50.0
));
//place
if
(
finished_before_timeout
)
{
ROS_DEBUG
(
"Action finished: %s"
,
pick_or_place_client_
.
getState
());
pickOrPlaceBlock
(
pregrasp_point
,
grasp_point
,
postgrasp_point
,
ini_grasp_EF_rpy
,
end_grasp_EF_rpy
,
1
,
false
);
}
else
{
ROS_DEBUG
(
"Action did not finish before the time out."
);
}
}
break
;
case
2
:
{
//initialize the pick and place location
int
pick_location
=
1
;
int
place_location
=
8
;
geometry_msgs
::
PoseStamped
board_frame
;
geometry_msgs
::
PoseStamped
iri_wam_link_base_frame
;
double
pick_grasp_block_z_ax
=
-
0.02
;
double
pick_pregrasp_block_z_ax
=
0.1
;
double
pick_postgrasp_block_z_ax
=
0.2
;
double
place_grasp_block_z_ax
=
0.2
;
double
place_pregrasp_block_z_ax
=
0.1
;
double
place_postgrasp_block_z_ax
=
0.25
;
tfTransformation2BoardFrame
(
pick_location
,
board_frame
,
iri_wam_link_base_frame
,
pick_grasp_block_z_ax
,
pick_pregrasp_block_z_ax
,
pick_postgrasp_block_z_ax
);
pickOrPlaceBlock
(
pregrasp_point
,
grasp_point
,
postgrasp_point
,
ini_grasp_EF_rpy
,
end_grasp_EF_rpy
,
1
,
true
);
tfTransformation2BoardFrame
(
place_location
,
board_frame
,
iri_wam_link_base_frame
,
place_grasp_block_z_ax
,
place_pregrasp_block_z_ax
,
place_postgrasp_block_z_ax
);
//wait for the action to return
bool
finished_before_timeout
=
pick_or_place_client_
.
waitForResult
(
ros
::
Duration
(
50.0
));
//place
if
(
finished_before_timeout
)
{
ROS_DEBUG
(
"Action finished: %s"
,
pick_or_place_client_
.
getState
());
pickOrPlaceBlock
(
pregrasp_point
,
grasp_point
,
postgrasp_point
,
ini_grasp_EF_rpy
,
end_grasp_EF_rpy
,
1
,
false
);
}
else
{
ROS_DEBUG
(
"Action did not finish before the time out."
);
}
}
break
;
case
3
:
{
//initialize the pick and place location
int
pick_location
=
1
;
int
place_location
=
8
;
geometry_msgs
::
PoseStamped
board_frame
;
geometry_msgs
::
PoseStamped
iri_wam_link_base_frame
;
double
pick_grasp_block_z_ax
=
-
0.02
;
double
pick_pregrasp_block_z_ax
=
0.1
;
double
pick_postgrasp_block_z_ax
=
0.2
;
double
place_grasp_block_z_ax
=
0.2
;
double
place_pregrasp_block_z_ax
=
0.1
;
double
place_postgrasp_block_z_ax
=
0.25
;
tfTransformation2BoardFrame
(
pick_location
,
board_frame
,
iri_wam_link_base_frame
,
pick_grasp_block_z_ax
,
pick_pregrasp_block_z_ax
,
pick_postgrasp_block_z_ax
);
pickOrPlaceBlock
(
pregrasp_point
,
grasp_point
,
postgrasp_point
,
ini_grasp_EF_rpy
,
end_grasp_EF_rpy
,
1
,
true
);
tfTransformation2BoardFrame
(
place_location
,
board_frame
,
iri_wam_link_base_frame
,
place_grasp_block_z_ax
,
place_pregrasp_block_z_ax
,
place_postgrasp_block_z_ax
);
//wait for the action to return
bool
finished_before_timeout
=
pick_or_place_client_
.
waitForResult
(
ros
::
Duration
(
50.0
));
//place
if
(
finished_before_timeout
)
{
ROS_DEBUG
(
"Action finished: %s"
,
pick_or_place_client_
.
getState
());
pickOrPlaceBlock
(
pregrasp_point
,
grasp_point
,
postgrasp_point
,
ini_grasp_EF_rpy
,
end_grasp_EF_rpy
,
1
,
false
);
}
else
{
ROS_DEBUG
(
"Action did not finish before the time out."
);
}
}
break
;
case
4
:
{
//initialize the pick and place location
int
pick_location
=
1
;
int
place_location
=
8
;
geometry_msgs
::
PoseStamped
board_frame
;
geometry_msgs
::
PoseStamped
iri_wam_link_base_frame
;
double
pick_grasp_block_z_ax
=
-
0.02
;
double
pick_pregrasp_block_z_ax
=
0.1
;
double
pick_postgrasp_block_z_ax
=
0.2
;
double
place_grasp_block_z_ax
=
0.2
;
double
place_pregrasp_block_z_ax
=
0.1
;
double
place_postgrasp_block_z_ax
=
0.25
;
tfTransformation2BoardFrame
(
pick_location
,
board_frame
,
iri_wam_link_base_frame
,
pick_grasp_block_z_ax
,
pick_pregrasp_block_z_ax
,
pick_postgrasp_block_z_ax
);
pickOrPlaceBlock
(
pregrasp_point
,
grasp_point
,
postgrasp_point
,
ini_grasp_EF_rpy
,
end_grasp_EF_rpy
,
1
,
true
);
tfTransformation2BoardFrame
(
place_location
,
board_frame
,
iri_wam_link_base_frame
,
place_grasp_block_z_ax
,
place_pregrasp_block_z_ax
,
place_postgrasp_block_z_ax
);
//wait for the action to return
bool
finished_before_timeout
=
pick_or_place_client_
.
waitForResult
(
ros
::
Duration
(
50.0
));
//place
if
(
finished_before_timeout
)
{
ROS_DEBUG
(
"Action finished: %s"
,
pick_or_place_client_
.
getState
());
pickOrPlaceBlock
(
pregrasp_point
,
grasp_point
,
postgrasp_point
,
ini_grasp_EF_rpy
,
end_grasp_EF_rpy
,
1
,
false
);
}
else
{
ROS_DEBUG
(
"Action did not finish before the time out."
);
}
}
break
;
case
5
:
{
//initialize the pick and place location
int
pick_location
=
1
;
int
place_location
=
8
;
geometry_msgs
::
PoseStamped
board_frame
;
geometry_msgs
::
PoseStamped
iri_wam_link_base_frame
;
double
pick_grasp_block_z_ax
=
-
0.02
;
double
pick_pregrasp_block_z_ax
=
0.1
;
double
pick_postgrasp_block_z_ax
=
0.2
;
double
place_grasp_block_z_ax
=
0.2
;
double
place_pregrasp_block_z_ax
=
0.1
;
double
place_postgrasp_block_z_ax
=
0.25
;
tfTransformation2BoardFrame
(
pick_location
,
board_frame
,
iri_wam_link_base_frame
,
pick_grasp_block_z_ax
,
pick_pregrasp_block_z_ax
,
pick_postgrasp_block_z_ax
);
pickOrPlaceBlock
(
pregrasp_point
,
grasp_point
,
postgrasp_point
,
ini_grasp_EF_rpy
,
end_grasp_EF_rpy
,
1
,
true
);
tfTransformation2BoardFrame
(
place_location
,
board_frame
,
iri_wam_link_base_frame
,
place_grasp_block_z_ax
,
place_pregrasp_block_z_ax
,
place_postgrasp_block_z_ax
);
//wait for the action to return
bool
finished_before_timeout
=
pick_or_place_client_
.
waitForResult
(
ros
::
Duration
(
50.0
));
//place
if
(
finished_before_timeout
)
{
ROS_DEBUG
(
"Action finished: %s"
,
pick_or_place_client_
.
getState
());
pickOrPlaceBlock
(
pregrasp_point
,
grasp_point
,
postgrasp_point
,
ini_grasp_EF_rpy
,
end_grasp_EF_rpy
,
1
,
false
);
}
else
{
ROS_DEBUG
(
"Action did not finish before the time out."
);
}
}
break
;
}
...
...
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