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

farhansajjad's profile - activity

2018-01-18 12:24:50 -0500 received badge  Famous Question (source)
2017-06-26 09:22:26 -0500 received badge  Notable Question (source)
2017-06-16 14:35:12 -0500 received badge  Famous Question (source)
2017-03-19 15:59:15 -0500 received badge  Notable Question (source)
2017-03-19 15:59:15 -0500 received badge  Popular Question (source)
2017-03-06 10:46:40 -0500 received badge  Nice Question (source)
2017-01-17 06:17:25 -0500 received badge  Notable Question (source)
2016-12-18 08:35:57 -0500 received badge  Popular Question (source)
2016-12-17 16:45:40 -0500 received badge  Editor (source)
2016-12-17 15:32:53 -0500 asked a question Segmentation fault in returning array from a class

I'm facing a strange problem. I'm running the ROS node on Intel Edison and in the node I'm reading the Bluetooth LE device MAC address and its RSSI value from a class which I've written in an external file. All functions are working correctly except one. When I try to get back the data from scan.read_decvice function it runs correctly for the first time but in the next iteration I get a segmentation fault.

while (ros::ok())
{
    bl_talker::beacon le_msg;
    dev_info devices[20];
    int num_dev = scan.read_device(device, 20, devices);
    while(num_dev > 0)
    {
        if(devices[num_dev-1].valid == 1)
        {
            le_msg.mac = devices[num_dev-1].dev_mac;
            le_msg.rssi = devices[num_dev-1].dev_rssi;
            le_msg.msg_count = devices[num_dev-1].dev_count;

            printf("%d: %s - RSSI %d\n", le_msg.msg_count, le_msg.mac.c_str(), le_msg.rssi);
            chatter_pub.publish(le_msg);
            num_dev--;
        }
    }
    ros::spinOnce();
    loop_rate.sleep();
}

If I write the function in the same file where my main is written, it runs without any problem. Also it runs smoothly if I remove the ROS part. It would be great if anyone can help me out.

2016-12-14 11:41:51 -0500 received badge  Popular Question (source)
2016-11-12 18:17:22 -0500 asked a question Bluetooth in a ROS package

Hi, I'm new in the ROS world. I just wanna know how I can use Bluetooth in a ROS package. I added Bluetooth libraries in the source file by:

#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/hci_lib.h>

and then I tried to retrieve the resource number to open the socket by:

dev_id = hci_get_route(NULL);
sock = hci_open_dev( dev_id );

but when I try to build this package I got errors saying:

undefined reference to `hci_get_route'

undefined reference to `hci_open_dev'

so this means the Bluetooth library is still not included. How I can add this? Any help will be appreciated.

2016-11-03 18:41:50 -0500 asked a question Programming on Intel Edison

Hi, I'm new to the ROS world. I've been playing with it for a week or two. I was able to configure Eclipse to write a program for ROS. My goal is to run a ROS package on Intel Edison.

So my question is that, is there any way to directly program Edison within Eclipse (as it can program it over ssh) or you have to write a package on Ubuntu and then move it to Edison manually ?

Thanks in advance for your help.

2016-10-31 12:32:25 -0500 received badge  Famous Question (source)
2016-10-29 07:48:56 -0500 received badge  Enthusiast
2016-10-28 13:14:56 -0500 received badge  Student (source)
2016-10-27 12:57:15 -0500 answered a question Running ROS across multiple machine

I got it working now. The reason was that i'm using ssh to access other machine and i was setting ROS_MASTER_URI for only one.

You have to set the environment variables for each terminal window if master is not on the same machine or you can add it to .bashrc. And yeah, setting only ROS_MASTER_URI will do the trick.

Thanks for your help, much appreciated.

2016-10-27 12:49:13 -0500 received badge  Supporter (source)
2016-10-27 12:48:47 -0500 received badge  Scholar (source)
2016-10-27 08:40:08 -0500 received badge  Notable Question (source)
2016-10-27 06:00:06 -0500 received badge  Popular Question (source)
2016-10-26 17:05:03 -0500 asked a question Running ROS across multiple machine

I'm trying to run ROS on two machines which are connected to a local network. Both can ping each other.

I started roscore on first machine and set the ROS_MASTER_URI=http://192.168.0.22:11311 to the second machine. When I run rosnode list on the second machine it shows /rosout node. But when I start a node on the second machine it fails saying:

[ERROR] [1477518161.033462327]: [registerPublisher] Failed to contact master at [localhost:11311].  Retrying...

It keeps looking for ros master on the same machine. I don't know why. Both machines are running Ros Indigo.

Any help would be much appreciated.

2016-10-24 14:37:23 -0500 asked a question Installing ros on Yocto

Hi, I'm trying to install ROS on Intell Edison which is running Yocto linux. Is there any guide which I can follow. I tried to search but no luck. Thanks in advance.