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

Revision history [back]

click to hide/show revision 1
initial version

The 'time_from_start' field must be a sub message of type 'Duration'

You are using the wrong type of object. These two object types are not interchangable: rclpy.Duration and builtin_interfaces.msg.Duration

Also see https://index.ros.org/p/builtin_interfaces/

The 'time_from_start' field must be a sub message of type 'Duration'

You are using the wrong type of object. These two object types are not interchangable: rclpy.Duration rclpy.time.Duration and builtin_interfaces.msg.Duration

Also see https://index.ros.org/p/builtin_interfaces/

The 'time_from_start' field must be a sub message of type 'Duration'

You are using the wrong type of object. These two object types are not interchangable: rclpy.time.Duration and builtin_interfaces.msg.Duration

Also see https://index.ros.org/p/builtin_interfaces/You can convert between them using the time.Duration methods to_msg() and from_msg()

from rclpy.time import Duration
my_duration_msg = Duration(seconds=10.0).to_msg()