Beispiel #1
0
        public bool getData(ulong time_, ref TransformStorage data_out, ref string error_str)
        {
            TransformStorage temp1 = null, temp2 = null;
            int num_nodes;

            num_nodes = findClosest(ref temp1, ref temp2, time_, ref error_str);
            switch (num_nodes)
            {
            case 0:
                return(false);

            case 1:
                data_out = temp1;
                break;

            case 2:
                if (temp1.frame_id == temp2.frame_id)
                {
                    interpolate(temp1, temp2, time_, ref data_out);
                }
                else
                {
                    data_out = temp1;
                }
                break;

            default:
                ROS.FREAKOUT();
                break;
            }
            return(true);
        }
Beispiel #2
0
        private void construct(string ns, bool validate_name)
        {
            if (!ROS.initialized)
            {
                ROS.FREAKOUT();
            }
            collection          = new NodeHandleBackingCollection();
            UnresolvedNamespace = ns;
            Namespace           = validate_name ? resolveName(ns) : resolveName(ns, true, true);

            ok = true;
            lock (nh_refcount_mutex)
            {
                if (nh_refcount == 0 && !ROS.isStarted())
                {
                    node_started_by_nh = true;
                    ROS.start();
                }
                ++nh_refcount;
            }
        }