Esempio n. 1
0
        public virtual void SetElement(URDFElement externalElement)
        {
            if (externalElement.GetType() != GetType())
            {
                throw new Exception("URDFElements need to be the same type to set the internal values");
            }

            foreach (Tuple <URDFAttribute, URDFAttribute> pair in
                     Enumerable.Zip(Attributes, externalElement.Attributes, Tuple.Create))
            {
                if (pair.Item2.Value != null && pair.Item2.Value.GetType() == typeof(double[]))
                {
                    double[] valueArray = (double[])pair.Item2.Value;
                    pair.Item1.Value = valueArray.Clone();
                }
                else
                {
                    pair.Item1.Value = pair.Item2.Value;
                }
            }

            foreach (Tuple <URDFElement, URDFElement> pair in
                     Enumerable.Zip(ChildElements, externalElement.ChildElements, Tuple.Create))
            {
                pair.Item1.SetElement(pair.Item2);
            }
        }
        public override void SetElement(URDFElement externalElement)
        {
            base.SetElement(externalElement);

            // The base method already performs the type check, so we don't have to for this cast
            Joint joint = (Joint)externalElement;

            // These strings aren't kept as URDFAttribute objects and so they are tracked separately
            CoordinateSystemName = joint.CoordinateSystemName;
            AxisName             = joint.AxisName;
        }
Esempio n. 3
0
 public override void SetElement(URDFElement externalElement)
 {
     base.SetElement(externalElement);
     SetSWComponents((Link)externalElement);
 }