Skip to content

Commit

Permalink
prev_traj_tm -> traj_start_tm
Browse files Browse the repository at this point in the history
  • Loading branch information
pazeshun committed Jul 11, 2018
1 parent c54fe61 commit f347672
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions hrpsys_ros_bridge/src/HrpsysJointTrajectoryBridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ void HrpsysJointTrajectoryBridge::jointTrajectoryActionObj::proc()

// FIXME: need to set actual informatoin, currently we set dummy information
trajectory_msgs::JointTrajectoryPoint commanded_joint_trajectory_point, error_joint_trajectory_point;
commanded_joint_trajectory_point.time_from_start = tm_on_execute - prev_traj_tm;
commanded_joint_trajectory_point.time_from_start = tm_on_execute - traj_start_tm;
commanded_joint_trajectory_point.positions.resize(joint_list.size());
commanded_joint_trajectory_point.velocities.resize(joint_list.size());
commanded_joint_trajectory_point.accelerations.resize(joint_list.size());
Expand All @@ -342,7 +342,7 @@ void HrpsysJointTrajectoryBridge::jointTrajectoryActionObj::proc()
commanded_joint_trajectory_point.accelerations[j] = parent->body->link(joint_list[j])->ddq;
commanded_joint_trajectory_point.effort[j] = parent->body->link(joint_list[j])->u;
}
error_joint_trajectory_point.time_from_start = tm_on_execute - prev_traj_tm;
error_joint_trajectory_point.time_from_start = tm_on_execute - traj_start_tm;
error_joint_trajectory_point.positions.resize(joint_list.size());
error_joint_trajectory_point.velocities.resize(joint_list.size());
error_joint_trajectory_point.accelerations.resize(joint_list.size());
Expand Down Expand Up @@ -504,7 +504,7 @@ void HrpsysJointTrajectoryBridge::jointTrajectoryActionObj::onJointTrajectory(
parent->m_service0->playPattern(angles, rpy, zmp, duration);
}
}
prev_traj_tm = ros::Time::now();
traj_start_tm = ros::Time::now();

interpolationp = true;
}
Expand Down
2 changes: 1 addition & 1 deletion hrpsys_ros_bridge/src/HrpsysJointTrajectoryBridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class HrpsysJointTrajectoryBridge : public RTC::DataFlowComponentBase
std::string groupname;
std::vector<std::string> joint_list;
bool interpolationp;
ros::Time prev_traj_tm;
ros::Time traj_start_tm;

public:
typedef boost::shared_ptr<jointTrajectoryActionObj> Ptr;
Expand Down
8 changes: 4 additions & 4 deletions hrpsys_ros_bridge/src/HrpsysSeqStateROSBridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ void HrpsysSeqStateROSBridge::onJointTrajectory(trajectory_msgs::JointTrajectory
OpenHRP::dSequenceSequence rpy, zmp;
m_service0->playPattern(angles, rpy, zmp, duration);
}
prev_traj_tm = ros::Time::now();
traj_start_tm = ros::Time::now();

interpolationp = true;
}
Expand Down Expand Up @@ -443,9 +443,9 @@ RTC::ReturnCode_t HrpsysSeqStateROSBridge::onExecute(RTC::UniqueId ec_id)
//joint_state.velocity
//joint_state.effort
follow_joint_trajectory_feedback.joint_names.push_back(j->name);
follow_joint_trajectory_feedback.desired.time_from_start = tm_on_execute - prev_traj_tm;
follow_joint_trajectory_feedback.actual.time_from_start = tm_on_execute - prev_traj_tm;
follow_joint_trajectory_feedback.error.time_from_start = tm_on_execute - prev_traj_tm;
follow_joint_trajectory_feedback.desired.time_from_start = tm_on_execute - traj_start_tm;
follow_joint_trajectory_feedback.actual.time_from_start = tm_on_execute - traj_start_tm;
follow_joint_trajectory_feedback.error.time_from_start = tm_on_execute - traj_start_tm;
follow_joint_trajectory_feedback.desired.positions.push_back(j->q);
follow_joint_trajectory_feedback.actual.positions.push_back(j->q);
follow_joint_trajectory_feedback.error.positions.push_back(0);
Expand Down
2 changes: 1 addition & 1 deletion hrpsys_ros_bridge/src/HrpsysSeqStateROSBridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class HrpsysSeqStateROSBridge : public HrpsysSeqStateROSBridgeImpl
void clock_cb(const rosgraph_msgs::ClockPtr& str) {};

bool follow_action_initialized;
ros::Time prev_traj_tm;
ros::Time traj_start_tm;

boost::mutex tf_mutex;
double tf_rate;
Expand Down

0 comments on commit f347672

Please sign in to comment.