Example #1
0
 /// <summary>
 /// Extends type <c>Pose</c> with a method <c>ToPoseStampedMessage</c>, which creates a message with frame and time stamp.
 /// In ROS the message geometry_msgs/Pose does not contain a frame_id. Therefore a PoseStamped message is also used
 /// whenever a relative pose with a parent frame_id has to be transmitted.
 /// </summary>
 /// <param name="pose">A <c>Pose</c> object</param>
 /// <param name="stamp">A <c>std_msgs.Time</c> message object</param>
 /// <returns>Returns an instance of <c>geometry_msgs.PoseStamped</c>.</returns>
 public static geometry_msgs.PoseStamped ToPoseStampedMessage(this Pose pose, std_msgs.Time stamp = null) =>
 new geometry_msgs.PoseStamped
 {
     header = new std_msgs.Header()
     {
         stamp = stamp ?? TimeData.Zero.ToMessage(), frame_id = pose.Frame
     },
     pose = pose.ToPoseMessage(),
 };
Example #2
0
        public override bool Equals(IRosMessage ____other)
        {
            if (____other == null)
            {
                return(false);
            }
            bool ret = true;

            std_msgs.Time other = (Messages.std_msgs.Time)____other;

            ret &= data.Equals(other.data);
            // for each SingleType st:
            //    ret &= {st.Name} == other.{st.Name};
            return(ret);
        }
Example #3
0
 /// <summary>
 /// Extends the type <c>Twist</c> with a method <c>ToTwistMessage</c>, which creates an time stamped twist message.
 /// </summary>
 /// <param name="twist">Twist</c> object to be extended</param>
 /// <param name="stamp">A time message</param>
 /// <returns>Returns an instance of <c>geometry_msgs.TwistStamped</c>.</returns>
 public static geometry_msgs.TwistStamped ToTwistStampedMessage(this Twist twist, std_msgs.Time stamp = null)
 {
     return(new geometry_msgs.TwistStamped()
     {
         header = new std_msgs.Header()
         {
             stamp = stamp ?? TimeData.Zero.ToMessage(), frame_id = twist.Frame
         },
         twist = twist.ToTwistMessage(),
     });
 }
Example #4
0
 /// <summary>
 /// Extends type <c>Quaternion</c> with a method <c>ToQuaternionMessageStamped</c>, which creates a time stamped message.
 /// </summary>
 /// <param name="value">A <c>Quaternion</c> object</param>
 /// <param name="stamp">A <c>std_msgs.Time</c> message object</param>
 /// <param name="frameId">A string representing the frameId</param>
 /// <returns>Returns an instance of <c>geometry_msgs.QuaternionStamped</c>.</returns>
 public static geometry_msgs.QuaternionStamped ToQuaternionMessageStamped(this Quaternion value, std_msgs.Time stamp, string frameId = "") =>
 new geometry_msgs.QuaternionStamped
 {
     header = new std_msgs.Header()
     {
         stamp = stamp, frame_id = frameId
     },
     quaternion = value.ToQuaternionMessage()
 };