Skip to content
This repository has been archived by the owner on Oct 9, 2019. It is now read-only.

Final fix for plugin reset #12

Merged
merged 2 commits into from
Jan 7, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions mara_gazebo_plugins/src/mara_gazebo_joint_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,14 +401,21 @@ void MARAGazeboPluginRos::Load(gazebo::physics::ModelPtr _model, sdf::ElementPtr

void MARAGazeboPluginRos::Reset()
{

impl_->trajectories_position_axis1.clear();
impl_->trajectories_velocities_axis1.clear();
impl_->trajectories_position_axis2.clear();
impl_->trajectories_velocities_axis2.clear();
impl_->executing_axis1 = false;
impl_->executing_axis2 = false;
impl_->index_trajectory_axis1 = 0;
impl_->index_trajectory_axis2 = 0;
impl_->goal_position_axis1_rad = 0;
impl_->goal_position_axis2_rad = 0;
}

void MARAGazeboPluginRosPrivate::OnUpdate(const gazebo::common::UpdateInfo & _info)
{

double seconds_since_last_update = (_info.simTime - last_update_time_).Double();

if(!executing_axis1 && trajectories_position_axis1.size()>0){
index_trajectory_axis1 = 0;
executing_axis1 = true;
Expand Down