Closed ahendrix closed 11 years ago
[sachinc] Here's a snippet of code to add an object to the collision map. Put this in your code before you send a command to the controller.
object.dimensions are height,width,length of the box pose.position.z is where the box is centered.
Needed header file:
Code:
ros::NodeHandle nh;
ros::Publisher object_in_mappub;
object_in_mappub = nh.advertise
//push the box into the collision space mapping_msgs::CollisionObject table_object; table_object.operation.operation = mapping_msgs::CollisionObjectOperation::ADD; table_object.header.frame_id = "base_footprint"; table_object.header.stamp = ros::Time::now(); geometric_shapes_msgs::Shape object; object.type = geometric_shapes_msgs::Shape::BOX; object.dimensions.resize(3); object.dimensions[0] = 3.0; object.dimensions[1] = 3.0; object.dimensions[2] = 0.1; geometry_msgs::Pose pose; pose.position.x = 0.0; pose.position.y = 0.0; pose.position.z = 16.0*0.0254; pose.orientation.x = 0; pose.orientation.y = 0; pose.orientation.z = 0; pose.orientation.w = 1; table_object.shapes.push_back(object); table_object.poses.push_back(pose);
ros::Duration(2.0).sleep();//waiting for connection table_object.id = "table"; object_in_mappub.publish(table_object);
[watts] Still validating a version of this.
[watts] r34727, have arms code working. Still need some tuning.
[watts] I think this is better captured by #4028
We need to test this today. Can you add a virtual obstacle to 16" above ground level to the PR2 burn in test?
The launch file to modify is
life_test/pr2_test/pr2_arm_controllers.launch
.trac data: