diff --git a/doc/bullet_collision_checker/src/bullet_collision_checker_tutorial.cpp b/doc/bullet_collision_checker/src/bullet_collision_checker_tutorial.cpp index bf50e5566..579b05526 100644 --- a/doc/bullet_collision_checker/src/bullet_collision_checker_tutorial.cpp +++ b/doc/bullet_collision_checker/src/bullet_collision_checker_tutorial.cpp @@ -157,7 +157,8 @@ int main(int argc, char** argv) { // BEGIN_TUTORIAL // The code starts with creating an interactive robot and a new planning scene. - InteractiveRobot interactive_robot("robot_description", "bullet_collision_tutorial/interactive_robot_state"); + InteractiveRobot interactive_robot("ready", "robot_description", + "bullet_collision_tutorial/interactive_robot_state"); g_planning_scene = std::make_unique(interactive_robot.robotModel()); // Changing the collision detector to Bullet diff --git a/doc/interactivity/include/interactivity/interactive_robot.h b/doc/interactivity/include/interactivity/interactive_robot.h index d4cd93b1c..5fec746d4 100644 --- a/doc/interactivity/include/interactivity/interactive_robot.h +++ b/doc/interactivity/include/interactivity/interactive_robot.h @@ -55,7 +55,7 @@ class InteractiveRobot { public: - InteractiveRobot(const std::string& robot_description = "robot_description", + InteractiveRobot(const std::string& start_pose, const std::string& robot_description = "robot_description", const std::string& robot_topic = "interactive_robot_state", const std::string& marker_topic = "interactive_robot_markers", const std::string& imarker_topic = "interactive_robot_imarkers"); diff --git a/doc/interactivity/src/interactive_robot.cpp b/doc/interactivity/src/interactive_robot.cpp index 9d38fa5fb..1c69f0900 100644 --- a/doc/interactivity/src/interactive_robot.cpp +++ b/doc/interactivity/src/interactive_robot.cpp @@ -50,8 +50,9 @@ const double InteractiveRobot::WORLD_BOX_SIZE_ = 0.15; // minimum delay between calls to callback function const ros::Duration InteractiveRobot::min_delay_(0.01); -InteractiveRobot::InteractiveRobot(const std::string& robot_description, const std::string& robot_topic, - const std::string& marker_topic, const std::string& imarker_topic) +InteractiveRobot::InteractiveRobot(const std::string& start_pose, const std::string& robot_description, + const std::string& robot_topic, const std::string& marker_topic, + const std::string& imarker_topic) : user_data_(nullptr) , nh_() // this node handle is used to create the publishers // create publishers for markers and robot state @@ -80,10 +81,10 @@ InteractiveRobot::InteractiveRobot(const std::string& robot_description, const s ROS_ERROR("Could not get RobotState from Model"); throw RobotLoadException(); } - robot_state_->setToDefaultValues(); // Prepare to move the "panda_arm" group group_ = robot_state_->getJointModelGroup("panda_arm"); + robot_state_->setToDefaultValues(group_, start_pose); std::string end_link = group_->getLinkModelNames().back(); desired_group_end_link_pose_ = robot_state_->getGlobalLinkTransform(end_link); diff --git a/doc/subframes/src/subframes_tutorial.cpp b/doc/subframes/src/subframes_tutorial.cpp index 2e7967250..14f260c20 100644 --- a/doc/subframes/src/subframes_tutorial.cpp +++ b/doc/subframes/src/subframes_tutorial.cpp @@ -247,6 +247,7 @@ int main(int argc, char** argv) att_coll_object.object.id = "cylinder"; att_coll_object.link_name = "panda_hand"; att_coll_object.object.operation = att_coll_object.object.ADD; + att_coll_object.touch_links = { att_coll_object.link_name }; ROS_INFO_STREAM("Attaching cylinder to robot."); planning_scene_interface.applyAttachedCollisionObject(att_coll_object); // END_SUB_TUTORIAL @@ -319,7 +320,7 @@ int main(int argc, char** argv) target_orientation.setRPY(0, 180.0 / 180.0 * M_PI, 90.0 / 180.0 * M_PI); target_pose.pose.orientation = tf2::toMsg(target_orientation); // To keep some distance to the box, we use a small offset: - target_pose.pose.position.z = 0.01; + target_pose.pose.position.z = 0.03; showFrames(target_pose, "cylinder/tip"); moveToCartPose(target_pose, group, "cylinder/tip"); // END_SUB_TUTORIAL @@ -332,7 +333,7 @@ int main(int argc, char** argv) target_pose.header.frame_id = "box/top"; target_orientation.setRPY(180.0 / 180.0 * M_PI, 0, 90.0 / 180.0 * M_PI); target_pose.pose.orientation = tf2::toMsg(target_orientation); - target_pose.pose.position.z = 0.01; + target_pose.pose.position.z = 0.03; showFrames(target_pose, "cylinder/tip"); moveToCartPose(target_pose, group, "cylinder/tip"); } @@ -343,7 +344,7 @@ int main(int argc, char** argv) target_pose.header.frame_id = "box/corner_1"; target_orientation.setRPY(0, 180.0 / 180.0 * M_PI, 90.0 / 180.0 * M_PI); target_pose.pose.orientation = tf2::toMsg(target_orientation); - target_pose.pose.position.z = 0.01; + target_pose.pose.position.z = 0.03; showFrames(target_pose, "cylinder/tip"); moveToCartPose(target_pose, group, "cylinder/tip"); } @@ -352,7 +353,7 @@ int main(int argc, char** argv) target_pose.header.frame_id = "box/corner_2"; target_orientation.setRPY(0, 180.0 / 180.0 * M_PI, 90.0 / 180.0 * M_PI); target_pose.pose.orientation = tf2::toMsg(target_orientation); - target_pose.pose.position.z = 0.01; + target_pose.pose.position.z = 0.03; showFrames(target_pose, "cylinder/tip"); moveToCartPose(target_pose, group, "cylinder/tip"); } @@ -361,7 +362,7 @@ int main(int argc, char** argv) target_pose.header.frame_id = "box/side"; target_orientation.setRPY(0, 180.0 / 180.0 * M_PI, 90.0 / 180.0 * M_PI); target_pose.pose.orientation = tf2::toMsg(target_orientation); - target_pose.pose.position.z = 0.01; + target_pose.pose.position.z = 0.05; showFrames(target_pose, "cylinder/tip"); moveToCartPose(target_pose, group, "cylinder/tip"); } @@ -421,6 +422,7 @@ int main(int argc, char** argv) att_coll_object.object.id = "cylinder"; att_coll_object.link_name = "panda_hand"; att_coll_object.object.operation = att_coll_object.object.ADD; + att_coll_object.touch_links = { att_coll_object.link_name }; ROS_INFO_STREAM("Attaching cylinder to robot."); planning_scene_interface.applyAttachedCollisionObject(att_coll_object); } diff --git a/doc/visualizing_collisions/src/visualizing_collisions_tutorial.cpp b/doc/visualizing_collisions/src/visualizing_collisions_tutorial.cpp index ed3bf8c52..083133b08 100644 --- a/doc/visualizing_collisions/src/visualizing_collisions_tutorial.cpp +++ b/doc/visualizing_collisions/src/visualizing_collisions_tutorial.cpp @@ -170,7 +170,7 @@ int main(int argc, char** argv) // object as a wrapper that combines a robot_model with the cube and an interactive marker. We also // create a :planning_scene:`PlanningScene` for collision checking. If you haven't already gone through the // `planning scene tutorial <../planning_scene/planning_scene_tutorial.html>`_, you go through that first. - InteractiveRobot robot; + InteractiveRobot robot("ready"); /* Create a PlanningScene */ g_planning_scene = new planning_scene::PlanningScene(robot.robotModel());