Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
cobot1_TRON_testing
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
Christoph Schröter
cobot1_TRON_testing
Commits
ab759f53
Commit
ab759f53
authored
3 years ago
by
Christoph Schröter
Browse files
Options
Downloads
Patches
Plain Diff
No commit message
No commit message
parent
1d32add1
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/tron_adapter.cpp
+15
-2
15 additions, 2 deletions
src/tron_adapter.cpp
with
15 additions
and
2 deletions
src/tron_adapter.cpp
+
15
−
2
View file @
ab759f53
...
@@ -7,7 +7,8 @@
...
@@ -7,7 +7,8 @@
#include
<boost/make_shared.hpp>
#include
<boost/make_shared.hpp>
#include
<memory>
#include
<memory>
#include
<cooperation_msgs/PressureMsg.h>
#include
<cooperation_msgs/PressureMsg.h>
#include
<moveit_msgs/PickupActionResult.h>
#include
<moveit_msgs/PickupAction.h>
#include
<moveit_msgs/PlaceAction.h>
#include
<moveit_msgs/MoveItErrorCodes.h>
#include
<moveit_msgs/MoveItErrorCodes.h>
#include
<moveit_msgs/MoveGroupActionResult.h>
#include
<moveit_msgs/MoveGroupActionResult.h>
#include
<control_msgs/FollowJointTrajectoryAction.h>
#include
<control_msgs/FollowJointTrajectoryAction.h>
...
@@ -407,6 +408,12 @@ void on_pickup_result(const moveit_msgs::PickupActionResult::ConstPtr &msg) {
...
@@ -407,6 +408,12 @@ void on_pickup_result(const moveit_msgs::PickupActionResult::ConstPtr &msg) {
else
report_now
(
"pickup_fail"
);
else
report_now
(
"pickup_fail"
);
}
}
void
on_place_result
(
const
moveit_msgs
::
PlaceActionResult
::
ConstPtr
&
msg
)
{
if
(
msg
->
result
.
error_code
.
val
==
moveit_msgs
::
MoveItErrorCodes
::
SUCCESS
)
report_now
(
"place_success"
);
else
report_now
(
"place_fail"
);
}
void
on_move_result
(
const
control_msgs
::
FollowJointTrajectoryActionResult
::
ConstPtr
&
msg
){
void
on_move_result
(
const
control_msgs
::
FollowJointTrajectoryActionResult
::
ConstPtr
&
msg
){
if
(
msg
->
result
.
error_code
==
control_msgs
::
FollowJointTrajectoryResult
::
SUCCESSFUL
)
if
(
msg
->
result
.
error_code
==
control_msgs
::
FollowJointTrajectoryResult
::
SUCCESSFUL
)
report_now
(
"move_success"
);
report_now
(
"move_success"
);
...
@@ -432,6 +439,12 @@ void configuration_phase(ros::NodeHandle& nh){
...
@@ -432,6 +439,12 @@ void configuration_phase(ros::NodeHandle& nh){
mappings
.
push_back
(
map
);
mappings
.
push_back
(
map
);
output_subscribers
.
push_back
(
nh
.
subscribe
(
"/pickup/result"
,
10
,
on_pickup_result
));
output_subscribers
.
push_back
(
nh
.
subscribe
(
"/pickup/result"
,
10
,
on_pickup_result
));
map
=
Mapping
(
"/place/result"
,
"place_fail"
,
false
);
mappings
.
push_back
(
map
);
map
=
Mapping
(
"/place/result"
,
"place_success"
,
false
);
mappings
.
push_back
(
map
);
output_subscribers
.
push_back
(
nh
.
subscribe
(
"/place/result"
,
10
,
on_place_result
));
// there is a separate controller for hand movement, this one is for arm movement
// there is a separate controller for hand movement, this one is for arm movement
map
=
Mapping
(
"/position_joint_trajectory_controller/follow_joint_trajectory/result"
,
"move_fail"
,
false
);
map
=
Mapping
(
"/position_joint_trajectory_controller/follow_joint_trajectory/result"
,
"move_fail"
,
false
);
mappings
.
push_back
(
map
);
mappings
.
push_back
(
map
);
...
@@ -445,7 +458,7 @@ void configuration_phase(ros::NodeHandle& nh){
...
@@ -445,7 +458,7 @@ void configuration_phase(ros::NodeHandle& nh){
// add_var_to_channel(socketfd, "ausloesen", "lokal");
// add_var_to_channel(socketfd, "ausloesen", "lokal");
uint64_t
microseconds
=
1000000
;
// one second
uint64_t
microseconds
=
1000000
;
// one second
// documentation states 2 signed integers are used for some reason
// documentation states 2 signed integers are used for some reason
set_time_unit_and_timeout
(
microseconds
,
3
00
);
set_time_unit_and_timeout
(
microseconds
,
6
00
);
// wait till subscribers initialized
// wait till subscribers initialized
for
(
ros
::
Publisher
&
pub
:
input_publishers
)
{
for
(
ros
::
Publisher
&
pub
:
input_publishers
)
{
...
...
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