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

b2256's profile - activity

2020-05-24 09:13:22 -0500 marked best answer Catkin_make error: virtual memory exhausted: Cannot allocate memory

Relative noob having enough knowledge to get into trouble.... Attempting to compile robot_localization package (along with a couple of drivers- ublox gps and christa imu). Goes along fine at first:

#### Running command: "make cmake_check_build_system" in "/media/sdcard/catkin_ws/build"
####
####
#### Running command: "make -j1 -l1" in "/media/sdcard/catkin_ws/build"
####
[  1%] Built target filter_utilities
[  1%] Built target _robot_localization_generate_messages_check_deps_SetDatum
[  1%] Built target geometry_msgs_generate_messages_cpp
[  1%] Built target std_msgs_generate_messages_cpp
[  1%] Built target _robot_localization_generate_messages_check_deps_SetPose
[  1%] Built target geographic_msgs_generate_messages_cpp
[  2%] Built target robot_localization_generate_messages_cpp
[  2%] Built target robot_localization_gencpp
[  3%] Built target filter_base
[  3%] Built target ekf
[  4%] Built target ros_filter_utilities
[  5%] Built target ukf
[  5%] Building CXX object robot_localization/CMakeFiles/ros_filter.dir/src/ros_filter.cpp.o
In file included from /opt/ros/indigo/include/ros/ros.h:40:0,
                 from /opt/ros/indigo/include/tf2_ros/buffer.h:38,
#################################################################
Then fails at the very end of the compilation:
                                  ^
/opt/ros/indigo/include/rosconsole/macros_generated.h:60:36: note: in expansion of macro ‘ROS_LOG’
 #define ROS_DEBUG_NAMED(name, ...) ROS_LOG(::ros::console::levels::Debug, std::string(ROSCONSOLE_NAME_PREFIX) + "." + name, __VA_ARGS__)
                                    ^
/opt/ros/indigo/include/tf2_ros/message_filter.h:53:3: note: in expansion of macro ‘ROS_DEBUG_NAMED’
   ROS_DEBUG_NAMED("message_filter", "MessageFilter [target=%s]: ", fmt, getTargetFramesString().c_str(), __VA_ARGS__)
   ^
/opt/ros/indigo/include/tf2_ros/message_filter.h:282:5: note: in expansion of macro ‘TF2_ROS_MESSAGEFILTER_DEBUG’
     TF2_ROS_MESSAGEFILTER_DEBUG("%s", "Cleared");
     ^
virtual memory exhausted: Cannot allocate memory
make[2]: *** [robot_localization/CMakeFiles/ros_filter.dir/src/ros_filter.cpp.o] Error 1
make[1]: *** [robot_localization/CMakeFiles/ros_filter.dir/all] Error 2
make: *** [all] Error 2
Invoking "make -j1 -l1" failed
ubuntu@arm:/media/sdcard/catkin_ws$
#############################

This is being performed on a Beaglebone Black with: Linux arm 4.1.1-ti-r2 #1 SMP PREEMPT Wed Jul 8 18:40:57 UTC 2015 armv7l armv7l armv7l GNU/Linux

I am out of ideas now. There should be plenty of memory:

ubuntu@arm:/media/sdcard/catkin_ws$ free
             total       used       free     shared    buffers     cached
Mem:        502088      43824     458264        380       3104       9768
-/+ buffers/cache:      30952     471136
Swap:            0          0          0

Any ideas are gratefully accepted! Perhaps this is too much for this board/sd card mix? (sd card is vfat FAT32) Thanks in advance, B2256


Thank you allenh1.

It seems that I was also able to find an answer based upon the swap file solution while waiting for answers. Other BBB users may also try this for a similar solution. It turns out that allenh1's point of the BBB only having 512MB is well founded and that "anything non-trivial will fail to compile with an out-of-memory error" according to the second source. Compiling was slow as noted, but appears to work aside from a clock skew warning. Thank you all again.

2020-05-17 00:29:10 -0500 received badge  Nice Answer (source)
2019-01-23 10:42:45 -0500 received badge  Notable Question (source)
2018-12-30 19:42:37 -0500 received badge  Nice Question (source)
2018-09-20 08:51:37 -0500 received badge  Nice Answer (source)
2018-09-19 14:30:14 -0500 marked best answer Bad Python code for custom message node - eating up cpu?

Wrote a custom message and am attempting to publish (via bagfile playback) for use in another node . The python roll/pitch/yaw is based upon this previous answer(link text ), although poorly executed on my part. (License omitted for brevity) The remaining dependent code is at this Dropbox link: https://www.dropbox.com/sh/u3kznp4oiy...

   #!/usr/bin/python
# -*- coding: utf-8 -*-
#subscribes to quaternions, converts quaternions to Euler angles, and then publish the Euler angles. The Euler angles are in a custom message
# Start up ROS pieces.
PKG = 'loc2orbgt'
import roslib; roslib.load_manifest(PKG)
import rospy
import math
import tf

# ROS messages.
from nav_msgs.msg import Odometry
from sensor_msgs.msg import Imu
from loc2orbgt.msg import Eulers

class QuatToEuler():
    def __init__(self):
        self.got_new_msg = False
        self.euler_msg = Eulers()

        # Create subscribers and publishers.
        #sub_imu   = rospy.Subscriber("imu/data", Imu, self.imu_callback)
        sub_rlocl  = rospy.Subscriber("odometry/filtered", Odometry, self.rlocl_callback)
        pub_euler = rospy.Publisher("euler", Eulers,queue_size=1)

        # Main while loop.
        while not rospy.is_shutdown():
            # Publish new data if we got a new message.
            if self.got_new_msg:
                pub_euler.publish(self.euler_msg)
                rate = rospy.Rate(15) # 15hz
                self.got_new_msg = False

    # Odometry callback function.
    def rlocl_callback(self, msg):
       # Convert quaternions to Euler angles.
       (r, p, y) = tf.transformations.euler_from_quaternion([msg.pose.pose.orientation.x, -msg.pose.pose.orientation.y, -msg.pose.pose.orientation.z, -msg.pose.pose.orientation.w]) 

       #(r, p, y) = [r*180/math.pi, p*180/math.pi, y*180/math.pi]
       (r, p, y) = [r*180/math.pi, p*180/math.pi, (y*180/math.pi)+(11.8599971761+90)]
       self.fill_euler_msg(msg, r, p, y)

    # Fill in Euler angle message.
    def fill_euler_msg(self, msg, r, p, y):
        self.got_new_msg = True
        self.euler_msg.header.stamp = msg.header.stamp
        self.euler_msg.roll  = r
        self.euler_msg.pitch = p
        self.euler_msg.yaw   = y

# Main function.    
if __name__ == '__main__':
    # Initialize the node and name it.
    rospy.init_node('quat_to_euler')
    # Go to class functions that do all the heavy lifting. Do error checking.
    try:
        quat_to_euler = QuatToEuler()
    except rospy.ROSInterruptException: pass

The code (q2_rpy.py) seems to work fine, but I found that the second node ( a time syncro node) would not initiate after being called by the launch file. Upon further investigation, it turns out that the former rpy code was using waaaay too much cpu. (See Screenshot). image description

Could it be that is the reason for second node not subscribing? Is there a better way regarding loop efficiency? Not sure where to go from here as the second node has a dependency on this one. As always, any insight will be greatly appreciated.

B2256

2018-03-08 01:08:20 -0500 received badge  Necromancer (source)
2018-03-08 01:08:20 -0500 received badge  Self-Learner (source)
2018-03-07 23:23:16 -0500 answered a question Python ApproximateTimeSynchronizer callback working but no sync

Old question but I thought it might help someone else with an answer. Turns out that the filter buffer was being overra

2017-11-28 13:02:53 -0500 marked best answer Robot_localization diagnostics topic question

I'm currently attempting to fine-tune an instance of (ekf) robot_localization using gps and single imu devices. In doing so, the diagnostic topic lists:

- 
    level: 1
    name: ekf_localization: Filter diagnostic updater
    message: Potentially erroneous data or settings detected for a robot_localization state estimation node.
    hardware_id: none
    values: 
      - 
        key: imu0_pose_covariance
        value: The covariance at position (35), which corresponds to YAW variance, was zero. This will be replaced with a small value to maintain filter stability, but should be corrected at the message origin node.
  -

The location of “position (35)” YAW covariance eludes me in attempting to revise the value. I've searched all the code for robot_localization and the code for the Phidgets 1044 imu to no avail. The ekf_localization launch file initial covariance is set (currently at a non-zero value of 0.035). The "message origin node" is the elusive part.

Aside from the ekf_localization initial_estimate_covariance, is there anywhere left to look for modification?

Thanks in advance for any insight.

B2256

2017-09-13 18:05:24 -0500 marked best answer Robot_localization: Reason(s) not to post-process filter input data?

Just made a run with my assembly of gps/imu/BeagleBone Black on a vehicle platform. While running the ekf filter, I performed a topic speed check on the /gps/filtered topic while recording a bagfile. It turns out that doing so, greatly reduces the output from about 26 Hz to 5 Hz! Must be out of bandwidth?

Can I pull the input data from the bagfile and rerun the filter through post-processing later? Or is the sim time issue going to play into it?

Thanks as always,

B2256

2017-09-05 11:34:09 -0500 received badge  Popular Question (source)
2017-04-25 08:14:26 -0500 received badge  Famous Question (source)
2017-04-25 07:46:50 -0500 received badge  Taxonomist
2017-04-20 14:53:03 -0500 marked best answer ekf_localization: odometry/filtered topic:Frequency too low?

I am using robot_localization to fuse gps and imu referencing this Tom Moore answer: http://answers.ros.org/question/20007...

My setup is the same with a full-size SUV vehicle, Beaglebone Black board, Phidgets imu w/mag, ublox gps, with no odometry sensors. I am running Ubuntu 14.04.4 LTS, deb 4.1.15-ti-rt-r40 armv7l, ros indigo, and robot_localization with the ekf filter.

I've been able to produce decent results, but the mobile trial awaits resolving issues, so everything is tested in the static position. I've calibrated the magnetometer for hard and soft iron on the vehicle and incorporate the factors in the driver. I use an overall launch file that separately calls the devices and robot_localization. REP's 103 and 105 were adhered to with the imu (as far as I can tell), since the raw mag points (X) east at zero and the other checks (Y and Z) work out. Declination is accounted for in the navsat_transform launch file.

The issue arises with the diagnostic output where this occurs:

level: 1 
  name: ekf_localization: odometry/filtered topic status 
  message: Frequency too low. 
  hardware_id: none 
  values: 
    - 
      key: Events in window 
      value: 17 
    - 
      key: Events since startup   
      value: 172 
    - 
    key: Duration of window (s) 
    value: 16.443676 
    - 
      key: Actual frequency (Hz)  
      value: 1.033832 
    - 
      key: Minimum acceptable frequency (Hz) 
      value: 55.800000 
    -
      key: Minimum acceptable frequency (Hz) 
      value: 72.600000

I've checked the frequencies of all the incoming topics and they all seem ok except for the /tf topic which also shows around 1 hz. The transform frames correctly seem to tie odom to base_link with child frames phid_imu and gps.

A secondary factor may be in play is the 0 yaw covariance factor produced by the Phidgets imu driver. I cannot seem to find where this can be adjusted to help convergence. The gps is running at 4hz(fortunately) so it will determine all gps inputs (ie. /odometry/gps).

I am asking how to resolve the low ekf_localization diagnostic issue and will likely have to ask another question about the yaw covariance in the Phidgets driver.

I've placed the diagnostic output, device output, launch files, node graph, and transform tree on Dropbox https://www.dropbox.com/sh/u3kznp4oiy...

Any ideas towards this end? Please forgive the text formatting.

Regards and Thank you,

b2256

EDIT 03/10/16 Per Tom Moore's comment below, I did perform the ekf/imu test and found that if the data rate value in the imu was slowed to 40ms, the frequencies of /odometry/filtered and /tf were helped. I then implemented the full launch with the same result although it takes a few minutes to stabilize. Will these values at 25 hz be sufficient for operation? Additional tweaks involved reducing the ekf data rate to 28 hz hoping to stabilize (with limited success at ~25.6 hz, std dev 0.0155s, and max of 0.353s). Note that these results were via ssh (from a Windows laptop) into the ...

(more)
2017-04-10 11:17:10 -0500 commented answer Bad Python code for custom message node - eating up cpu?

Although not an answer, my solution was to post-process raw bagfiles. Not clean, but seems to overcome this problem.

2017-03-24 08:27:53 -0500 received badge  Notable Question (source)
2017-03-24 08:27:53 -0500 received badge  Popular Question (source)
2017-03-15 05:23:29 -0500 received badge  Famous Question (source)
2017-03-15 03:25:57 -0500 received badge  Famous Question (source)
2017-03-09 15:39:45 -0500 received badge  Famous Question (source)
2016-12-21 13:57:40 -0500 commented answer Robot_localization ekf vs ukf process noise

Thank you Tom. That verifies my assumptions. Still tuning Q matrix and hoped that effort would apply to both ekf and ukf. Regards.

2016-12-20 11:13:28 -0500 received badge  Notable Question (source)
2016-12-07 16:10:00 -0500 received badge  Famous Question (source)
2016-12-06 05:34:45 -0500 received badge  Popular Question (source)
2016-12-05 11:43:45 -0500 asked a question Robot_localization ekf vs ukf process noise

Attempting to compare results from both ekf and ukf (ubuntu, indigo). Would one expect to use the same process noise covariance matrix for both? Thanks

2016-12-02 14:59:13 -0500 received badge  Famous Question (source)
2016-11-23 10:48:57 -0500 received badge  Notable Question (source)
2016-08-11 10:09:03 -0500 commented question Python ApproximateTimeSynchronizer callback working but no sync

Still cannot get returned sync messages. Queue length or slop- neither seems to matter, yet the loginfo prints?? What else can affect this?

2016-08-07 23:58:12 -0500 asked a question Python ApproximateTimeSynchronizer callback working but no sync

Hi All:

I am using message_filters (python) ApproximateTimeSynchronizer to sync two topics in a class; one custom rpy msg (tat_bry) and output from robot_localization's navsat_transform (/gps/filtered). Both nodes appear in the default (/) namespace. The callback (see code snippet below) seems to be working as my roslog text message comes through "syncing'. When echoes for both topics, are initiated, there appears a difference in sequence numbers of around 5 and a disparity between topics of a maximum of slightly more than .06s using a 'slop' of 0.033s. After reading the documentation for both the C++ and Python version, I chose this value as 1/2 of the 16Hz frequency of 0.0625/s or about 0.033s.

After many forms of experimenting with queue sizes, and 'slop' parameters, changing input frequencies and namespaces to no avail; I cannot produce a synchronized set between the two topics. I wonder after looking at the affected portion of the node diagram, it appears that echoing the topics may be taking place prior to the synchronization?

Is there a way to echo the resultant output stream of the callback (after sync)? Are the topics spread too far to sync using this filter? I've used this filter before and did not seem to have this issue.

Using Ubuntu 14.04LTs, Indigo

Any insight is greatly appreciated.

B2256

class AflSync():
def __init__(self):
    self.got_new_msg = False
    self.tat_bry_msg = TatBry()
    self.sync_msg = Sync_orb()

# Create subscribers and publishers
# subscriber to message_filters module and assigning to local class variable
    self.sub_gps = Subscriber("gps/filtered", NavSatFix)
    self.sub_rpy = Subscriber("tat_bry", TatBry)
# Synchronize topics
    ts = ApproximateTimeSynchronizer([self.sub_gps, self.sub_rpy], 2, 0.033)
    ts.registerCallback(self.cb_aflsync)

def cb_aflsync(self, sync_msg, tat_bry_msg):

    r = rospy.Rate(16) # 16hz
    rospy.loginfo('syncing')


    # Main while loop.
    while not rospy.is_shutdown():

        r.sleep()

afl_sync_node2.jpg

2016-08-05 11:41:55 -0500 received badge  Famous Question (source)
2016-08-02 19:31:08 -0500 received badge  Notable Question (source)
2016-07-31 13:09:57 -0500 asked a question Remapping and ApproximateTimeSynchronization

I've run into a seemingly simple issue that I cannot solve. I have a working model that takes sensor outpput and synchronizes messages using the python version of ApproximateTimeSynchronization. The issue likely is remapping related, but I cannot seem to produce output topics from the synchronization node to verify syncro topics. My launch file is:

launch>

        <node pkg="bag2orb" type="ned_rpy_imu.py" name="afl_tatbry_node"> 
        <remap from="tat_bry" to="tat_bry"/> 
        </node>


         <node pkg="bag2orb" type="afl_apprxtimesync_node.py" name="aflsync_node"> 
                <remap from="tat_bry" to="tatbryout"/>  
                <remap from="gps/filtered" to="gpsout"/>   
         </node>         

  </launch>

And a partial node map:

image description

I've read the documentation on remapping and have been unsucessful remapping both topics to another relative topic. From the log files, the syncro seems to be working. What syntax am I missing for either ApprTimeSynchro or general remapping? My desire is to republish the synchronized topics under the remapped names.

Any insight would be greatly appreciated.

Thank you,

B2256

2016-07-18 02:42:45 -0500 received badge  Popular Question (source)
2016-07-17 12:21:44 -0500 asked a question Quaternion to Euler angle convention in TF

In reference to this question , the desired conversion is the opposite direction. That is using tf.transformations.euler_from_quaternion function, taking the result from robot_localization of /odometry/filtered topic, my attempt is to unravel the quaternion from the ENU convention to NED convention. The end result should be pitch, yaw, and roll using the aviation (NED) convention.

My interpretation is that one must first change back (from ROS ENU) the signs of y and z, followed by “unwinding” the quaternion to euler from 'rzyx' to 'rxyz' per the documentation for euler_from_quaternion definition and the question response: “q = tf.transformations.quaternion_from_euler(yaw, pitch, roll, 'rzyx')”

My question: Is my interpretation correct? Any insight is greatly appreciated.

B2256

2016-07-16 12:41:40 -0500 received badge  Popular Question (source)
2016-07-15 08:02:43 -0500 commented answer plot/print rpy from quaternion

Since this post is somewhat dated, can I ask if it applies REP-103 using ENU? If so what needs to be changed to convert rpy back to NED coordinate frame convention?

2016-06-16 18:40:51 -0500 received badge  Notable Question (source)
2016-06-16 05:29:14 -0500 received badge  Famous Question (source)