Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
panda_mqtt_connector
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
CeTI
ROS
ROS Packages
panda_mqtt_connector
Commits
47542001
Commit
47542001
authored
Jun 22, 2020
by
Johannes Mey
Browse files
Options
Downloads
Patches
Plain Diff
move in semi-circle
parent
426f67aa
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/TimedPlanner.cpp
+12
-13
12 additions, 13 deletions
src/TimedPlanner.cpp
with
12 additions
and
13 deletions
src/TimedPlanner.cpp
+
12
−
13
View file @
47542001
...
...
@@ -10,6 +10,7 @@
#include
<moveit/trajectory_processing/iterative_time_parameterization.h>
#include
<trajectory_msgs/JointTrajectoryPoint.h>
#include
<tf2/transform_datatypes.h>
#include
<tf2_geometry_msgs/tf2_geometry_msgs.h>
#include
"util/TrajectoryUtil.h"
...
...
@@ -29,26 +30,22 @@ namespace PlannerState {
}
void
initCircularTrajector
(
moveit
::
planning_interface
::
MoveGroupInterface
*
group
,
double
radius
,
double
origin_x
,
double
origin_y
,
double
origin
_z
,
double
granularity
){
void
initCircularTrajector
y
(
double
radius
,
geometry_msgs
::
Point
origin
,
double
granularity
){
geometry_msgs
::
Pose
startPose
=
group
->
getCurrentPose
().
pose
;
double
step_size_rad
=
2
*
M_PI
/
granularity
;
for
(
double
i
=
0
;
i
<
granularity
;
i
++
){
double
next_rad
=
step_size_rad
*
i
;
double
next_rad
=
step_size_rad
*
(
2
*
i
>
granularity
?
granularity
-
i
:
i
)
;
tf2
::
Quaternion
orientation
{
0
,
M_PI
,
next_rad
};
tf2
::
Quaternion
orientation
;
// the RPY constructor is deprecated
orientation
.
setRPY
(
0
,
M_PI
,
next_rad
);
geometry_msgs
::
Pose
nextPose
;
nextPose
.
orientation
.
w
=
orientation
.
w
();
nextPose
.
orientation
.
x
=
orientation
.
x
();
nextPose
.
orientation
.
y
=
orientation
.
y
();
nextPose
.
orientation
.
z
=
orientation
.
z
();
nextPose
.
position
.
z
=
origin_z
;
nextPose
.
position
.
y
=
origin_y
+
radius
*
cos
(
next_rad
);
nextPose
.
position
.
x
=
origin_x
+
radius
*
sin
(
next_rad
);
nextPose
.
orientation
=
tf2
::
toMsg
(
orientation
);
nextPose
.
position
.
x
=
origin
.
x
+
radius
*
sin
(
next_rad
);
nextPose
.
position
.
y
=
origin
.
y
+
radius
*
cos
(
next_rad
);
nextPose
.
position
.
z
=
origin
.
z
;
PlannerState
::
raw_trajectory
.
push_back
(
nextPose
);
std
::
cout
<<
"added: "
<<
nextPose
<<
std
::
endl
;
...
...
@@ -60,7 +57,9 @@ void initRawTrajectory(ros::NodeHandle node_handle, moveit::planning_interface::
geometry_msgs
::
Pose
current_pose
=
group
->
getCurrentPose
().
pose
;
if
(
useCircularDefault
){
initCircularTrajector
(
group
,
0.6
,
0.0
,
0.0
,
0.3
,
20.0
);
geometry_msgs
::
Point
origin
;
origin
.
z
=
.3
;
initCircularTrajectory
(
0.6
,
origin
,
20.0
);
return
;
}
...
...
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