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 hideRobot to hide visualized robot state by setting hide_display in DisplayRobotState msg #56

Merged
merged 4 commits into from
Aug 15, 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
17 changes: 5 additions & 12 deletions src/moveit_visual_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1527,20 +1527,13 @@ void MoveItVisualTools::publishRobotState(const moveit_msgs::DisplayRobotState&

bool MoveItVisualTools::hideRobot()
{
static const std::string VJOINT_NAME = "virtual_joint";

// Always load the robot state before using
loadSharedRobotState();

// Apply transform
Eigen::Isometry3d offset;
offset.translation().x() = rviz_visual_tools::LARGE_SCALE;
offset.translation().y() = rviz_visual_tools::LARGE_SCALE;
offset.translation().z() = rviz_visual_tools::LARGE_SCALE;
applyVirtualJointTransform(*hidden_robot_state_, offset);
moveit_msgs::DisplayRobotState display_robot_state_msg;
// Hide the robot state
display_robot_state_msg.hide = true;

// Publish
return publishRobotState(hidden_robot_state_);
publishRobotState(display_robot_state_msg);
rhaschke marked this conversation as resolved.
Show resolved Hide resolved
return true;
}

void MoveItVisualTools::showJointLimits(const robot_state::RobotStatePtr& robot_state)
Expand Down