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

aak2166's profile - activity

2021-10-06 08:00:58 -0500 received badge  Great Question (source)
2021-06-29 07:59:22 -0500 received badge  Famous Question (source)
2019-09-29 00:00:10 -0500 received badge  Taxonomist
2019-03-01 06:39:53 -0500 received badge  Good Question (source)
2019-02-27 15:30:30 -0500 received badge  Popular Question (source)
2019-02-27 15:30:30 -0500 received badge  Notable Question (source)
2018-06-24 07:26:58 -0500 received badge  Nice Question (source)
2018-05-17 13:35:03 -0500 marked best answer ROSSerial Arduino Arrays

Hi All,

I'm trying to use Rosserial Arduino to process some data from a low cost laser rangefinder. Over the course of a scan I try to add the data to an array of float in arduino:

float snd_distance = getDistance(servo_pos);
distance_array[servo_pos] = snd_distance;

Then I have a function which populates the message:

void populateMessage(float distances[145]){  
 //Set up frame data
  scanData.header.frame_id = "1";
  scanData.header.seq = scanData.header.seq++;
  scanData.header.stamp = nh.now();
  scanData.angle_min = 0.0;
  scanData.angle_max = 2.53072742;
  scanData.angle_increment = 0.0174532925; 
  scanData.range_min = 0;
  scanData.range_max = 40;  
  for(int i = 0; i <= 144; i++){
    scanData.ranges[i] = distances[i];
  }
  pub_scan.publish(&scanData);
  nh.spinOnce();
}

However, there seems to be a problem copying the values of distances over to scanData.ranges. I see no errors during compilation, however execution locks up at that step and I seem unable to get past it. Has anyone seen this before? Many thanks.

2018-03-29 13:14:48 -0500 received badge  Notable Question (source)
2018-03-29 13:14:48 -0500 received badge  Popular Question (source)
2017-10-20 17:49:35 -0500 marked best answer roslibjs MultiArray Message

Hi all,

I am trying to create a web interface for a robot, and would like to publish a message of type:

std_msgs/Int32MultiArray

Thus in my code I have the following statement to create the message:

var msg = new ROSLIB.Message({
  data : [1 , 2, 3]
});

However, when I attempt to publish that in my browser I see a Javascript error of type 'cannot read property of undefined.'

I suspect it has to do with the way I am trying to set the message data, but cannot find an example of the proper way to do so. Has anyone had any luck with this?

Thanks.

2017-09-18 18:35:32 -0500 received badge  Good Question (source)
2017-01-19 14:36:42 -0500 marked best answer roslaunch stuck on 'Loading robot model'

Hi all.

I'm trying to run a moveit path that I have planned out with the following launch file:

<launch>
    <arg name="urdf_file" default="$(find planar_2d_description)/urdf/planar_2d.urdf" />
    <arg name="srdf_file" default="$(find planar_2d_config)/config/planar_2d.srdf" />
    <param name="robot_description" command="cat $(arg urdf_file)" />
    <param name="robot_description_semantic" command="cat $(arg srdf_file)" />
    <include file="$(find planar_2d_config)/launch/planar_2d_moveit_controller_manager.launch.xml"/>
    <node
        pkg="planar_2d_planning"
        type="project_part_one"
        name="planning_node"
        output="screen"
    />
</launch>

However, on launch ROS seems to hang up at this step:

[ INFO] [1428960470.895442847]: Loading robot model 'planar_2d'...

And if I kill it with ctrl+C:

terminate called after throwing an instance of 'std::runtime_error' what(): Unable to connect to move_group action server within allotted time (2)

I'm at a loss as to what can be causing this. The paths to my urdf and srdf are correct, and I am passing the param the contents of the file with cat, not just the path.

If anyone has any ideas it would be greatly appreciated. Thanks.

2016-11-11 14:48:21 -0500 received badge  Famous Question (source)
2016-09-28 12:06:11 -0500 marked best answer How do Publisher/Subscriber Message Queues Work?

Hi all,

I can't seem to find any documentation on this, but it I want to understand more deeply how messaging queues work.

My understanding is that each node has its own publisher and subscriber queues, and it is up the ROS backend to pull messages from publisher queues and push them onto subscriber queues.

Let's say I have a publisher that publishes int32s at a fast rate into a queue of size 10. When my node runs the publish() function, it will push values onto the end of the queue, [1, 2, 3, 4, 5, ...]. If the queue grows too large, queue_size will drop the values at the front of the queue leaving me with [2, 3, 4, 5, 6, ...]. Similarly, if ROS sends the first message in the queue over the wire that automatically pops it and leaves us with the same message queue of [2, 3, 4, 5, 6, ...].

Now on the subscriber end it seems like the logic is when the callback is called the first value is popped, similarly to the above, if the subscriber queue_size is exceeded, the backend is the one that pops the first values and will append the new one to the end in a FIFO manner.

Is this somewhat correct? Thanks!

2016-09-18 23:05:06 -0500 marked best answer Why use joint_state_publisher?

Hi all,

I was looking through the documentation for the joint_state_publisher package. I can see the use case for wanting so publish and set joint states via the GUI, but what is the purpose of having the node subscribe to incoming sensor_msgs/JointState messages?

It seems to me that if you are working in hardware, there is no reason to do that. The node will just subscribe via:

source_list (list of strings, default: [])
A list of topics to listen on for sensor_msgs/JointState messages.

and spit them back out again.

Does anybody have any insights on this? Thanks.

2016-09-18 14:48:35 -0500 received badge  Notable Question (source)
2016-09-16 00:38:04 -0500 received badge  Popular Question (source)