ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Maestre's profile - activity

2018-03-14 05:31:41 -0500 commented question Smooth arm trajectory with JointTrajectoryPoint

Hi ! Any updates on it? Thanks

2015-01-20 10:28:01 -0500 received badge  Famous Question (source)
2015-01-08 16:19:51 -0500 received badge  Famous Question (source)
2014-11-25 08:32:56 -0500 commented answer install ros-hydro-pr2-desktop on ubuntu 14.04 with indigo

Guys, any news about the port of PR2 to Indigo?

2014-10-29 11:03:43 -0500 received badge  Notable Question (source)
2014-10-14 20:06:57 -0500 received badge  Notable Question (source)
2014-09-05 00:32:43 -0500 received badge  Popular Question (source)
2014-09-04 10:57:16 -0500 answered a question PR2 + Hydro - Easiest way to close a gripper?

Guys, any ideas?

2014-09-02 11:03:21 -0500 received badge  Supporter (source)
2014-09-02 03:47:17 -0500 commented answer PR2 + Hydro - Easiest way to close a gripper?

Yes, it is the first case. I tried to increase the speed, setting max_effort to -1 or 200, but it still closes quite slow.

I remember some time ago, making tests, I was able to open and close a gripper just setting a value to a joint. That worked really fast, but I don't remember the joint name.

2014-09-01 09:47:37 -0500 asked a question PR2 + Hydro - Easiest way to close a gripper?

Hi all,

After interacting with some objects on a table, the grasp of the PR2 opens. I need to close it after each iteration, to be able to compare the changes in the scene before and after the interaction.

I look for something fast. So I guess the solution must be very simple. Something as setting a number to a joint, but I am not able to find it by myself...

I can close the gripper using Pr2GripperCommandAction but it is quite slow:

#include <ros/ros.h>
#include <pr2_controllers_msgs/Pr2GripperCommandAction.h>
#include <actionlib/client/simple_action_client.h>
#include <unistd.h>

// Our Action interface type, provided as a typedef for convenience
typedef actionlib::SimpleActionClient<pr2_controllers_msgs::Pr2GripperCommandAction> GripperClient;
GripperClient* gripper_clientr_;   
GripperClient* gripper_clientl_;   

  //Open the gripper
  void open(GripperClient* gripper_client_){
    pr2_controllers_msgs::Pr2GripperCommandGoal open;
    open.command.position = 0.10;
    open.command.max_effort = -1.0;  // Do not limit effort (negative)

    ROS_INFO("Sending open goal");
    gripper_client_->sendGoal(open);
    gripper_client_->waitForResult();
    if(gripper_client_->getState() == actionlib::SimpleClientGoalState::SUCCEEDED)
      ROS_INFO("The gripper opened!");
    else
      ROS_INFO("The gripper failed to open.");
  }

  //Close the gripper
  void close(GripperClient* gripper_client_){
    pr2_controllers_msgs::Pr2GripperCommandGoal squeeze;
    squeeze.command.position = 0.0;
//     squeeze.command.max_effort = 50.0;  // Close gently
    squeeze.command.max_effort = -1.0;  // Close gently

    ROS_INFO("Sending squeeze goal");
    gripper_client_->sendGoal(squeeze);
    gripper_client_->waitForResult();
    if(gripper_client_->getState() == actionlib::SimpleClientGoalState::SUCCEEDED)
      ROS_INFO("The gripper closed!");
    else
      ROS_INFO("The gripper failed to close.");

    gripper_client_->cancelAllGoals();

  }

int main(int argc, char** argv){
  ros::init(argc, argv, "simple_gripper");

  gripper_clientr_ = new GripperClient("r_gripper_controller/gripper_action", true);
  while(!gripper_clientr_->waitForServer(ros::Duration(5.0))){
    ROS_INFO("Waiting for the r_gripper_controller/gripper_action action server to come up");
  }  

  open(gripper_clientr_);
  close(gripper_clientr_);

  return 0;
}

Thanks

Carlos

2014-08-27 17:50:34 -0500 received badge  Popular Question (source)
2014-08-08 11:54:21 -0500 asked a question [Hydro] Getting pose of a spawned object in certain frame

Hi!

I am trying to spawn an object into the scene based on a frame, and afterwards take its position based on that frame. But it is not working when I try to spawn it using a part of the PR2 as frame:

(I put it with rosrun but it is the same thing if I use to code to spawn it)

rosrun gazebo_ros spawn_model -file rospack find pr2_dynamic_motion/worlds/box_big.urdf -urdf -y 1 -model box51 -robot_namespace box.urdf -reference_frame "pr2::base_footprint"

X Y Z should be 2 0 0 but if I take a look to the pose in Gazebo these are quite different, I guess that because the object was spawed using Gazebo's "world" frame.

Same X Y Z using:

rosservice call gazebo/get_model_state '{model_name: box51, relative_entity_name: "pr2::base_footprint"}'

So as this was not working I decided to transform the frame from /world to /base_footprint. But it is not getting the frames, and these exists if I execute "rosrun tf tf_monitor".

It looks like if it is not able to get the available frames. I guess I am initializing well the Transformer. Maybe it is because of the nodeHandler call? I am lost :-(

Frame transformation:

 #include " ros/ros.h "
 #include "gazebo_msgs/GetModelState.h"
 #include < cstdlib >
 #include < string >
 #include < tf/transform_listener.h >
 #include "geometry_msgs/PoseStamped.h"

int main(int argc, char **argv) {
  ros::init(argc, argv, "Get_object_info");
  ros::NodeHandle n;
  ros::ServiceClient client = n.serviceClient<gazebo_msgs::GetModelState>("gazebo/get_model_state");
  gazebo_msgs::GetModelState srv;
  srv.request.model_name = "box51";

  srv.request.relative_entity_name = "world";
  if (client.call(srv))
  {
    ROS_INFO_STREAM(srv.request.model_name << " position ");
    ROS_INFO_STREAM(srv.response.pose.position);
  }
  else
  {
    ROS_ERROR("Failed ");
    return 0;
  }

  tf::TransformListener* m_tfListener;

// Version 1 
  m_tfListener = new tf::TransformListener(n, ros::Duration(5), true);

  m_tfListener->waitForTransform("world", "base_footprint",
                                 ros::Time(0), ros::Duration(.50));

  tf::StampedTransform start_transform;
  m_tfListener->lookupTransform("world", "base_footprint",
                                ros::Time(0), start_transform);  

// Version 2
  geometry_msgs::PoseStamped pose_out;
  geometry_msgs::PoseStamped pose_in;

  pose_in.pose = srv.response.pose;
  pose_in.header.frame_id = "/world";
  pose_in.header.stamp = ros::Time::now();  

  std::string frame = "base_footprint";
  m_tfListener = new tf::TransformListener(n, ros::Duration(5), true);

  ROS_INFO_STREAM(m_tfListener->resolve("world")); // This makes nothing!!
  ROS_INFO_STREAM(m_tfListener->resolve("/world")); // This makes nothing!!

  m_tfListener->waitForTransform("/world", frame, ros::Time(0), ros::Duration(3.0));
  m_tfListener->transformPose(frame,
                 pose_in,
                 pose_out); 

  ROS_INFO_STREAM(pose_out.pose.position);

  return 1;                                   

}

Help! :-)

2014-08-05 03:10:42 -0500 asked a question Blocking wheels of PR2

Hi,

I am making a manipulation experiment with the PR2, and after several hundred iterations moving the arms it shifts a little bit its pose, and it gets far from the table in from of it.

I guess I can increase the friction value to the wheels in the pr2.urdf description, but I am wondering if there is some way of blocking the wheels writing some code.

Thanks

2014-08-01 06:31:43 -0500 received badge  Enthusiast
2014-07-29 10:09:55 -0500 answered a question Error using ros::shutdown and moveit

Hi! I am just having the same problem in CPP when using MoveGroup (for example, moveit::planning_interface::MoveGroup group("right_arm"));

As this makes my program to be killed when exiting I cannot use Valgrind to seek for memory leaks. Any solutions?

2014-07-21 10:35:12 -0500 received badge  Student (source)
2014-07-21 10:35:06 -0500 received badge  Notable Question (source)
2014-07-21 10:35:06 -0500 received badge  Famous Question (source)
2014-04-18 20:11:30 -0500 received badge  Popular Question (source)
2014-04-17 02:51:11 -0500 asked a question MoveIt! RobotStateDisplay tutorial: Ogre problem with Rviz

Hello,

I am following the MoveIt tutorials in Hydro and just got an important problem. After finalizing correctly the Kinematics/C++ API tutorial, it sends you to the RobotStateDisplay/C++ API tutorial.

After following all the steps, when finally running the launch file (roslaunch pr2_moveit_tutorials state_display_tutorial.launch) Rviz stops with the following output:

rviz: /build/buildd/ogre-1.7.4/OgreMain/src/OgreNode.cpp:393: virtual void Ogre::Node::setOrientation(const Ogre::Quaternion&): Assertion `!q.isNaN() && "Invalid orientation supplied as parameter"' failed.

The launch file executes properly creating several end-effector positions, shown in the output. But Rviz stops, so no possibility of seeing the execution of the movements in the robot.

I am using a HP Z800 workstation (Intel® Xeon(R) CPU E5520 @ 2.27GHz × 16), 16 GB RAM, with Ubuntu 12.10 (64 bits), ROS Hydro (up-to-date), MoveIt (up-to-date) and PR2 hydro-devel packages.

I saw a close problem at the end of this thread (I cannot post the link...) but talking about a problem in 32 bits machines.

Any possible idea of what's happening? Thanks ;-)

2014-03-26 04:08:38 -0500 commented answer hydro pr2 gazebo

Dear all, do you have any news about the update of the PR2 simulator to be compatible with Hydro? I just write here not to open a new thread just for this question.