PR2 / pr2_controllers

The controllers that run in realtime on the PR2 and supporting packages.
47 stars 35 forks source link

Add virtual obstacle at 16" above ground to PR2 burn in test (ros ticket #4091) #301

Closed ahendrix closed 11 years ago

ahendrix commented 11 years ago

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:

ahendrix commented 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:

include <mapping_msgs/CollisionObject.h>

Code:

ros::NodeHandle nh; ros::Publisher object_in_mappub; object_in_mappub = nh.advertise("collision_object", 10);

//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);

ahendrix commented 11 years ago

[watts] Still validating a version of this.

ahendrix commented 11 years ago

[watts] r34727, have arms code working. Still need some tuning.

ahendrix commented 11 years ago

[watts] I think this is better captured by #4028