SMACC
Loading...
Searching...
No Matches
smacc_client_library
move_group_interface_client
src
move_group_interface_client
client_behaviors
cb_undo_last_trajectory.cpp
Go to the documentation of this file.
1
/*****************************************************************************************************************
2
* ReelRobotix Inc. - Software License Agreement Copyright (c) 2018-2020
3
* Authors: Pablo Inigo Blasco, Brett Aldrich
4
*
5
******************************************************************************************************************/
6
#include <
move_group_interface_client/client_behaviors/cb_undo_last_trajectory.h
>
7
#include <
move_group_interface_client/components/cp_trajectory_history.h
>
8
9
namespace
cl_move_group_interface
10
{
11
12
CbUndoLastTrajectory::CbUndoLastTrajectory
()
13
{
14
}
15
16
CbUndoLastTrajectory::CbUndoLastTrajectory
(
int
backIndex)
17
: backIndex_(backIndex)
18
{
19
}
20
21
CbUndoLastTrajectory::~CbUndoLastTrajectory
()
22
{
23
}
24
25
void
CbUndoLastTrajectory::onEntry
()
26
{
27
CpTrajectoryHistory
*trajectoryHistory;
28
this->
requiresComponent
(trajectoryHistory);
29
this->
requiresClient
(
movegroupClient_
);
30
31
if
(trajectoryHistory->
getLastTrajectory
(
backIndex_
,
trajectory
))
32
{
33
auto
initialTime =
trajectory
.joint_trajectory.points.back().time_from_start;
34
35
reversed
=
trajectory
;
36
37
std::reverse(
reversed
.joint_trajectory.points.begin(),
reversed
.joint_trajectory.points.end());
38
39
for
(
auto
&jp :
reversed
.joint_trajectory.points)
40
{
41
jp.time_from_start = ros::Duration(fabs(jp.time_from_start.toSec() - initialTime.toSec()));
//ros::Duration(t);
42
}
43
44
this->
executeJointSpaceTrajectory
(
reversed
);
45
}
46
}
47
48
}
// namespace cl_move_group_interface
cb_undo_last_trajectory.h
cl_move_group_interface::CbMoveEndEffectorTrajectory::executeJointSpaceTrajectory
void executeJointSpaceTrajectory(const moveit_msgs::RobotTrajectory &computedJointTrajectory)
Definition:
cb_move_end_effector_trajectory.cpp:230
cl_move_group_interface::CbMoveEndEffectorTrajectory::movegroupClient_
ClMoveGroup * movegroupClient_
Definition:
cb_move_end_effector_trajectory.h:93
cl_move_group_interface::CbUndoLastTrajectory::backIndex_
int backIndex_
Definition:
cb_undo_last_trajectory.h:24
cl_move_group_interface::CbUndoLastTrajectory::CbUndoLastTrajectory
CbUndoLastTrajectory()
Definition:
cb_undo_last_trajectory.cpp:12
cl_move_group_interface::CbUndoLastTrajectory::onEntry
virtual void onEntry() override
Definition:
cb_undo_last_trajectory.cpp:25
cl_move_group_interface::CbUndoLastTrajectory::~CbUndoLastTrajectory
virtual ~CbUndoLastTrajectory()
Definition:
cb_undo_last_trajectory.cpp:21
cl_move_group_interface::CbUndoLastTrajectory::trajectory
moveit_msgs::RobotTrajectory trajectory
Definition:
cb_undo_last_trajectory.h:26
cl_move_group_interface::CbUndoLastTrajectory::reversed
moveit_msgs::RobotTrajectory reversed
Definition:
cb_undo_last_trajectory.h:27
cl_move_group_interface::CpTrajectoryHistory
Definition:
cp_trajectory_history.h:24
cl_move_group_interface::CpTrajectoryHistory::getLastTrajectory
bool getLastTrajectory(int backIndex, moveit_msgs::RobotTrajectory &trajectory)
Definition:
cp_trajectory_history.cpp:12
smacc::ISmaccClientBehavior::requiresComponent
void requiresComponent(SmaccComponentType *&storage)
Definition:
smacc_client_behavior_impl.h:60
smacc::ISmaccClientBehavior::requiresClient
void requiresClient(SmaccClientType *&storage)
Definition:
smacc_client_behavior_impl.h:54
cp_trajectory_history.h
cl_move_group_interface
Definition:
cl_movegroup.h:19
Generated by
1.9.5