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

erpa's profile - activity

2016-07-15 10:20:29 -0500 received badge  Famous Question (source)
2014-12-31 09:42:24 -0500 commented answer Extract time from .bag file

For some reason I was confused but yes the time is the third item in the tuple returned by read_messages(). Thanks for the help!

2014-12-31 09:38:17 -0500 received badge  Notable Question (source)
2014-12-25 06:25:16 -0500 received badge  Popular Question (source)
2014-12-22 08:15:32 -0500 asked a question Extract time from .bag file

Hi, I am trying to process some bag files and, while I am able to get the timestamp for each message, I am not able to get the actual time the message was received. Is it possible to get it? I am using the python api and I could not find any documentations, any help is really appreciated! Thanks for your help!

2014-01-28 17:25:16 -0500 marked best answer Handling SIGINT

Hi, I was trying to write a node acting as a tcp server, my first try (to see if evrythin worked) is the following

#include "iostream"
#include "vector"
#include "string"
#include "ros/ros.h"
#include "netinet/in.h"

using namespace std;

int main(int argc, char **argv)
{
  ros::init(argc, argv, "cobot_service_test");
  ros::NodeHandle n;

  int sockfd, newsockfd, portno;
  socklen_t clilen;
  char buffer[1024];
  struct sockaddr_in serv_addr, cli_addr;
  int ns;

  sockfd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
  bzero((char *) &serv_addr, sizeof(serv_addr));
  portno = 27015;
  serv_addr.sin_family = AF_INET;
  serv_addr.sin_addr.s_addr = INADDR_ANY;
  serv_addr.sin_port = htons(portno);

  if (bind(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0)
  {
      perror("ERROR on binding");
      exit(1);
  }

  printf("Starting the server\n");
  listen(sockfd,1);
  clilen = sizeof(cli_addr);
  newsockfd = accept(sockfd, NULL, NULL);

  if (newsockfd < 0)
  {
      perror("ERROR on accept");
      exit(1);
  }
  bzero(buffer,1024);

  while(ros::ok())
  {
      ns = recv(newsockfd,buffer,1023, 0);
      if (ns < 0)
      {
          perror("ERROR reading from socket\n");
          exit(1);
      }
      if (ns > 0)
      {
          printf("Message received: %s\n",buffer);
      }
  }

  return 0;
}

This works fine as server the problem is that I cant stop it using ctrl-c (but if i use the same code without ROS I can). I think I'm missing something on how ros::spin works but I really didn't understood how I'm supposed to use it. Thanks a lot for your help!

2014-01-28 17:24:49 -0500 marked best answer Display an image in gazebo

Hello, I wanted to simulate in Gazebo a system using a known target and a camera to compute the pose of the camera itself. I will use the ar_pose package the problem is that I am not able to display the know target. I'have tried creating a mesh (with blender) of the target and apply it to an object but I am having big trouble. First I don't know how to handle the material, I tryed to point, in the urdf, at the material file created with blender but it doesn't work and if I use a standrad material (like "blue") it doesn't display anything. Thanks for your help!

2014-01-28 17:24:45 -0500 marked best answer ar_pose message subscriber

Hi, I am trying to write a simple subscriber in order to read the messages published by ar_pose (as in the example 4.4 of http://www.ros.org/wiki/ar_pose) but I am having some trouble in finding how to import in my c++ code the definition of the message used. In particular I can't find a way to import the definition of ar_pose::ARMarker.

2014-01-28 17:23:20 -0500 marked best answer Trouble hand-writing a sensor_msgs::Joy

Hello everyone, I have a mobile wheeled robot that can be controlled through a joystick. I am trying to replace the joystick with another device but I also would like to leave the controller of the robot untouched. Since the controller read a sensor_msgs::Joy I'm trying to "hand-write" it and then publish it but I fail to set the dimension of the axes and button vector (and therefore their values). I tried both axes.resize() and set_axes_size() and they are not working but I suspect that, since i don't have the physical device, I'm failing to provide some needed parameters.

2014-01-28 17:23:13 -0500 marked best answer Is there a service call for getting the total inertia of a robot in Gazebo

Hello, I am working with gazebo and I have a model of a robot. I would like to know its total inertia. The robot is made by fixed link only so the inertia should always be the same. I tried looking for some kind of rosservice (like /gazebo/get_model_state) but couldn't find anything. thanks for your help!

2014-01-28 17:22:53 -0500 marked best answer Which unit of measurement does SetForce() use?

Hello evryone, I have a model of a quadrotor in matlab and to stabilize it at a fixed height I need a thrust of 6,3 N. I also have a simple model of the same quadrotor in gazebo controlled through a PD and it appears that the force applyed to stabilize it is 62.7, is it possible that the force is computed in 100*mN ??

2014-01-28 17:22:41 -0500 marked best answer applying a force to a rigid body

Hi all, I'm trying to write a controller for a robot that is modelled as a rigid body. In particular the robot is made by several link connected through fixed joints. I would like to apply a simple force along one of the axis to the main link of the robot. I tried to look at the erratic controller but i just found a way to apply velocity to the joints connected to the wheels. Is there a way to apply a force to a link?

thanks for your help!

EDIT: I'm working with gazebo and I would like to apply a force when a certain key is pushed (I already have implemented the teleoperation module). Is it possible to apply both an impulsive force and a continuos force?

2014-01-28 17:22:39 -0500 marked best answer Setting inertia for a whole robot

Hi all, I am trying to model a quadrotor, i have the .model file from an old implementation in gazebo but i need to rewrite it as a .urdf to be used in ROS. My problem is that rather then setting the inertia for each link i would like to set it for the whole robot (in fact the controller will consider the quadrotor as a unique body). Is it possible somehow?

Thank you

2013-08-05 22:36:49 -0500 received badge  Notable Question (source)
2013-08-05 22:36:49 -0500 received badge  Famous Question (source)
2013-08-05 22:36:49 -0500 received badge  Popular Question (source)
2013-07-09 13:17:55 -0500 marked best answer How to get the minimun ditsance from an obstacle

Hello, I'm working with gazebo and I would like to detect the minimum distance between my robot and an obstacle. The model of the robot is an urdf file. What is the best sensor to use? How do I "attach" it to the robot and how do I get the data? Thanks.