Time
Returns seconds of a time or duration
secs = seconds(time)
secs = seconds(duration)
example
secs = seconds(time) returns the scalar number, secs, in seconds that represents the same value as the time object, time.
secs
time
secs = seconds(duration) returns the scalar number, secs, in seconds that represents the same value as the duration object, duration.
duration
collapse all
Use the seconds function to get the total seconds of a Time object from its Secs and Nsecs properties.
seconds
Secs
Nsecs
Create a Time object.
time = rostime(1,860000000)
time = ROS Time with properties: Sec: 1 Nsec: 860000000
Get the total seconds from the time object.
secs = 1.8600
ROS or system time, specified as a Time object handle. Create a Time object using rostime.
rostime
Duration
Duration, specified as a ROS Duration object with Sec and Nsec properties. Create a Duration object using rosduration.
Sec
Nsec
rosduration
Total time of the Time or Duration object, returned as a scalar in seconds.
rosduration | rostime
You have a modified version of this example. Do you want to open this example with your edits?