Skip to content

Commit 4b524bc

Browse files
authored
Clean imarker_end_effector.cpp
Removed dead code
1 parent 89aa0b6 commit 4b524bc

File tree

1 file changed

+1
-36
lines changed

1 file changed

+1
-36
lines changed

src/imarker_end_effector.cpp

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,6 @@ bool isStateValid(const planning_scene::PlanningScene* planning_scene, bool verb
5959
robot_state->setJointGroupPositions(group, ik_solution);
6060
robot_state->update();
6161

62-
#if 0 // Ensure there are objects in the planning scene
63-
const std::size_t num_collision_objects = planning_scene->getCollisionEnv()->getWorld()->size();
64-
if (num_collision_objects == 0)
65-
{
66-
RCLCPP_ERROR(LOGGER, "No collision objects exist in world, you need at least a table "
67-
"modeled for the controller to work");
68-
RCLCPP_ERROR(LOGGER, "To fix this, relaunch the teleop/head tracking/whatever MoveIt "
69-
"node to publish the collision objects");
70-
return false;
71-
}
72-
#endif
73-
7462
if (!planning_scene)
7563
{
7664
RCLCPP_ERROR(LOGGER, "No planning scene provided");
@@ -163,7 +151,6 @@ void IMarkerEndEffector::iMarkerCallback(
163151

164152
// Only allow one feedback to be processed at a time
165153
{
166-
// boost::unique_lock<boost::mutex> scoped_lock(imarker_mutex_);
167154
if (!imarker_ready_to_process_)
168155
{
169156
return;
@@ -183,10 +170,7 @@ void IMarkerEndEffector::iMarkerCallback(
183170
imarker_callback_(feedback, robot_ee_pose);
184171

185172
// Allow next feedback to be processed
186-
{
187-
// boost::unique_lock<boost::mutex> scoped_lock(imarker_mutex_);
188-
imarker_ready_to_process_ = true;
189-
}
173+
imarker_ready_to_process_ = true;
190174
}
191175

192176
void IMarkerEndEffector::solveIK(Eigen::Isometry3d& pose)
@@ -210,16 +194,7 @@ void IMarkerEndEffector::solveIK(Eigen::Isometry3d& pose)
210194
if (imarker_state_->setFromIK(arm_data_.jmg_, pose, arm_data_.ee_link_->getName(), timeout, constraint_fn))
211195
{
212196
imarker_state_->update();
213-
// if (psm_->getPlanningScene()->isStateValid(*imarker_state_))
214-
//{
215-
// ROS_INFO_STREAM_NAMED(name_, "Solved IK");
216197
imarker_parent_->publishRobotState();
217-
//}
218-
// else
219-
// {
220-
// visual_tools_->publishRobotState(imarker_state_, rviz_visual_tools::RED);
221-
// exit(0);
222-
// }
223198
}
224199
}
225200

@@ -235,7 +210,6 @@ void IMarkerEndEffector::initializeInteractiveMarkers()
235210
void IMarkerEndEffector::updateIMarkerPose(const Eigen::Isometry3d& /*pose*/)
236211
{
237212
// Move marker to tip of fingers
238-
// imarker_pose_ = pose * imarker_offset_.inverse();
239213
sendUpdatedIMarkerPose();
240214
}
241215

@@ -255,15 +229,7 @@ void IMarkerEndEffector::make6DofMarker(const geometry_msgs::msg::Pose& pose)
255229
int_marker_.header.frame_id = "world";
256230
int_marker_.pose = pose;
257231
int_marker_.scale = 0.2;
258-
259232
int_marker_.name = name_;
260-
// int_marker_.description = "imarker_" + name_; // TODO: unsure, but I think this causes a caption in Rviz that I
261-
// don't want
262-
263-
// insert a box
264-
// makeBoxControl(int_marker_);
265-
266-
// int_marker_.controls[0].interaction_mode = InteractiveMarkerControl::MENU;
267233

268234
InteractiveMarkerControl control;
269235
control.orientation.w = 1;
@@ -301,7 +267,6 @@ void IMarkerEndEffector::make6DofMarker(const geometry_msgs::msg::Pose& pose)
301267

302268
imarker_server_->insert(int_marker_, std::bind(&IMarkerEndEffector::iMarkerCallback, this, std::placeholders::_1));
303269

304-
// menu_handler_.apply(*imarker_server_, int_marker_.name);
305270
}
306271

307272
visualization_msgs::msg::InteractiveMarkerControl&

0 commit comments

Comments
 (0)