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

Andrea019's profile - activity

2019-02-21 02:35:33 -0500 received badge  Famous Question (source)
2019-02-21 02:35:33 -0500 received badge  Notable Question (source)
2019-02-21 02:35:33 -0500 received badge  Popular Question (source)
2017-04-12 09:39:49 -0500 received badge  Famous Question (source)
2017-01-19 00:45:09 -0500 received badge  Notable Question (source)
2016-12-24 10:58:08 -0500 commented answer sprintf. process has died exit code -11

thank you! I initialize it like char persona[10| instead of char *persona and it worked!

PD: sorry for the spanish

2016-12-24 10:56:54 -0500 received badge  Scholar (source)
2016-12-24 06:57:06 -0500 received badge  Popular Question (source)
2016-12-22 00:05:52 -0500 asked a question sprintf. process has died exit code -11

I have to get data from a kinect, and to compute some angles.

So, I have this code that worked perfectly in ros Groovy, Ubuntu 12 and now I have to change the machine and work with indigo Ubuntu 14.04. Its the same folder, the same procedure but it crashes when i launch it, and I am not able to find out why this is happening :(

[listener_tf-1] process has died [pid 11824, exit code -11, cmd /home/andrea/catkin_ws/devel/lib/listener_tf/listener_tf __name:=listener_tf __log:=/home/andrea/.ros/log/dcee0976-c7d7-11e6-b6d6-083e8e6b82c1/listener_tf-1.log].log file: /home/andrea/.ros/log/dcee0976-c7d7-11e6-b6d6-083e8e6b82c1/listener_tf-1*.log

There is not a log file in the directory that it says it is, btw :(

I have done the "comment and uncomment stuff" to identify the error, and I know the thing is right in this part of the code (It crashes if either the sprintf line or the listener.lookupTransform line are uncomment):

for (int i=1;i<10;i++)
    {
        int n = sprintf(persona,"%d",i);
        /** itoa convert integer to string (non standard function
         * sprintf(target_string,"%d",source_int) */
        try
        {
            listener.lookupTransform("/openni_depth_frame", "/torso_"+std::string(persona), ros::Time(0), torso);
            break;
        }
        catch (tf::TransformException ex)
        {
        }

Here is the full code, thank you in advance !

#include <stdio.h>
#include <sstream>
#include <iostream>
#include <string>
#include <ros/ros.h>
#include <geometry_msgs/Twist.h>
#include <std_msgs/Header.h>
#include <tf/transform_listener.h>

void imprime_torso (tf::StampedTransform torso)
{
    float torso_x = torso.getOrigin().x();
    float torso_y = torso.getOrigin().y();
    printf("\n\ntorso.x = %f",torso_x);
    printf("\ntorso.y = %f",torso_y);
}


    void imprime_rodilla (tf::StampedTransform left_knee, tf::StampedTransform right_knee)
    {
        float rod_izq_x = left_knee.getOrigin().x();
        float rod_izq_y = left_knee.getOrigin().y();
        float rod_der_x = right_knee.getOrigin().x();
        float rod_der_y = right_knee.getOrigin().y();
        printf("\n\nrodilla.izq.x = %f",rod_izq_x);
    printf("\nrodilla.izq.y = %f",rod_izq_y);
    printf("\nrodilla.der.x = %f",rod_der_x);
    printf("\nrodilla.der.y = %f",rod_der_y);
}

void imprime_cadera (tf::StampedTransform left_hip, tf::StampedTransform right_hip)
{
    float cad_izq_x = left_hip.getOrigin().x();
    float cad_izq_y = left_hip.getOrigin().y();
    float cad_der_x = right_hip.getOrigin().x();
    float cad_der_y = right_hip.getOrigin().y();
    printf("\n\ncadera.izq.x = %f",cad_izq_x);
    printf("\ncadera.izq.y = %f",cad_izq_y);
    printf("\ncadera.der.x = %f",cad_der_x);
    printf("\ncadera.der.y = %f",cad_der_y);
}

void imprime_pie (tf::StampedTransform left_foot, tf::StampedTransform right_foot)
{
    float pie_izq_x = left_foot.getOrigin().x();
    float pie_izq_y = left_foot.getOrigin().y();
    float pie_der_x = right_foot.getOrigin().x();
    float pie_der_y = right_foot.getOrigin().y();
    printf("\n\npie.izq.x = %f",pie_izq_x);
    printf("\npie.izq.y = %f",pie_izq_y);
    printf("\npie.der.x = %f",pie_der_x);
    printf("\npie.der.y = %f",pie_der_y);
}

int main(int argc, char** argv)
{
    ros::init(argc, argv, "listener_tf");
    ros::NodeHandle node;
    ros::Rate rate(10.0);

    char *persona;
    tf::TransformListener listener;
    //(void)sprintf(persona,"%d",1);

    while (node.ok())
    {
        tf::StampedTransform torso;
        tf::StampedTransform left_hip;
        tf::StampedTransform left_knee;
        tf::StampedTransform left_foot;
        tf::StampedTransform right_hip;
        tf::StampedTransform right_knee;
        tf::StampedTransform right_foot;
       for (int i=1;i<10;i++)
        {
            int n = sprintf(persona,"%d",i);

            try
            {
                listener.lookupTransform("/openni_depth_frame", "/torso_"+std::string(persona), ros::Time(0), torso);
                break;
            }
            catch (tf::TransformException ...
(more)
2016-12-15 20:53:30 -0500 commented answer syntax error near unexpected token [SOLVED]

Hello! I have the same problem :) which file is the one made with the rosmake? :(

2016-07-22 12:13:36 -0500 received badge  Enthusiast
2016-07-18 09:34:21 -0500 commented answer parse error

I solved by deleting the catkin_ws and creating a new one.. It might be radical but it worked.. Thank you anyway jarvis :)

2016-07-18 09:24:07 -0500 asked a question install qt_ros URL not found

Hello..! I am using ubuntu 14.04 LTS and ROS Indigo I have tried to install the package by the instructions on this page: http://library.isr.ist.utl.pt/docs/ro... It says that I should be able to use

rosinstall ~/ros https://raw.github.com/stonier/qt_ros/master/qt_ros.rosinstall

replacing of course ~/ros with wherever your existing install is.

ros is installed in /opt/ros

So I did:

rosinstall ~opt/ros https://raw.github.com/stonier/qt_ros/master/qt_ros.rosinstall

and this is the error that shows:

ERROR in config: Unable to download URL [https://raw.github.com/stonier/qt_ros/master/qt_ros.rosinstall]: HTTP Error 404: Not Found

am I doing something wrong?

I also download the package using: https://github.com/stonier/qt_ros But i don't actually know how to install it.

I think this may be trivial, I'm sorry, I am newbe with ROS and QT Thank you for your help!

2016-07-17 20:15:41 -0500 commented answer Where is ros.h supposed to be found?

Hello.. im sorry I am totally new with this.. I have the same error.. where is the manifest.xml file supposed to be? I dont have anything similar in my package folder :(

2016-07-17 19:16:46 -0500 commented answer parse error

Hello..! Thank you.. i tried what you said but I still have the same problem. Do you know about another solution?

2016-07-17 15:17:35 -0500 received badge  Supporter (source)