Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update start_state after execution on Moveit #83

Merged
merged 1 commit into from
Jan 30, 2019
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <geometry_msgs/PoseStamped.h>
#include <std_msgs/Float64.h>
#include <std_msgs/String.h>
#include <std_msgs/Empty.h>
#include <boost/thread.hpp>
#include <unistd.h>

Expand Down Expand Up @@ -71,6 +72,7 @@ class OpenManipulatorController
std::vector<ros::Publisher> open_manipulator_kinematics_pose_pub_;
ros::Publisher open_manipulator_joint_states_pub_;
std::vector<ros::Publisher> gazebo_goal_joint_position_pub_;
ros::Publisher moveit_update_start_state_;

// ROS Subscribers
ros::Subscriber open_manipulator_option_sub_;
Expand Down
10 changes: 10 additions & 0 deletions open_manipulator_controller/src/open_manipulator_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ void OpenManipulatorController::initPublisher()
gazebo_goal_joint_position_pub_.push_back(pb);
}
}
if (using_moveit_ == true)
{
moveit_update_start_state_ = node_handle_.advertise<std_msgs::Empty>("rviz/moveit/update_start_state", 10);
}
}
void OpenManipulatorController::initSubscriber()
{
Expand Down Expand Up @@ -746,6 +750,12 @@ void OpenManipulatorController::moveitTimer(double present_time)
{
step_cnt = 0;
moveit_plan_flag_ = false;
if (moveit_update_start_state_.getNumSubscribers() == 0)
{
robotis_manipulator_log::warn("Could not update the start state! Enable External Communications at the Moveit Plugin");
}
std_msgs::Empty msg;
moveit_update_start_state_.publish(msg);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion open_manipulator_moveit/launch/moveit.rviz
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Visualization Manager:
Enabled: true
Move Group Namespace: ""
MoveIt_Allow_Approximate_IK: false
MoveIt_Allow_External_Program: false
MoveIt_Allow_External_Program: true
MoveIt_Allow_Replanning: false
MoveIt_Allow_Sensor_Positioning: false
MoveIt_Goal_Tolerance: 0
Expand Down