ROS中一个关于时间的函数

double x=ros::Time::now().toSec();//把时间戳转化成浮点型格式
反函数:.header.stamp = ros::Time().fromSec(x);//把浮点型变成时间戳

  • 7
    点赞
  • 29
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
`compute_cartesian_path`函数是MoveIt一个非常有用的函数,可以用来计算机器人末端执行器的直线或圆弧路径。该函数的完整定义如下: ```python def compute_cartesian_path(self, waypoints, eef_step, jump_threshold, avoid_collisions=True, path_constraints=None, attached_object_touch_links=None, moveit_msgs_opts=None): """ Compute a sequence of waypoints that make the end-effector move in straight line segments that follow the poses specified as a list of waypoints. :param waypoints: A list of waypoints that specify the poses for the end-effector to move through. Each waypoint is specified as a `geometry_msgs.msg.PoseStamped` message. :param eef_step: The distance in meters between consecutive waypoints on the returned path. This value effectively controls the granularity of the computed path. :param jump_threshold: The maximum distance in configuration space that the end-effector is allowed to travel in a single step. If the distance between consecutive configurations along the resulting path exceeds this value, the path is considered invalid and will not be returned. :param avoid_collisions: Whether to check for collisions between the robot and the environment as the path is being computed. If collisions are detected, the computed path will be modified to avoid the obstacles. :param path_constraints: A `moveit_msgs.msg.Constraints` message that specifies constraints to be enforced on the computed path. If `None`, no constraints will be used. :param attached_object_touch_links: A list of link names that specify which links the attached object is allowed to touch during the motion. If `None`, the default value of the `touch_links` parameter in the `planning_scene_interface` constructor will be used. :param moveit_msgs_opts: Advanced options for the computation of the path. This is a dictionary of key-value pairs, where the keys are strings and the values are either integer, float or string values. The available options are the same as those that can be set in the `moveit_msgs.msg.RobotTrajectory` message. :returns: `(plan, fraction)` where `plan` is a `moveit_msgs.msg.RobotTrajectory` message that describes the computed path, and `fraction` is a float value between 0.0 and 1.0 that specifies the fraction of the path that was successfully computed. If `fraction` is less than 1.0, the returned plan should be considered invalid. """ ``` 其,参数的含义如下: - `waypoints`:一个包含机器人末端执行器路径的列表,每个路径点都是一个`geometry_msgs.msg.PoseStamped`消息。 - `eef_step`:机器人末端执行器在计算出的路径使用的步长,以米为单位,控制路径的粒度。 - `jump_threshold`:在计算出的路径允许的连续步长之间的最大距离,以配置空间的距离为单位。如果连续的配置之间的距离超过此值,则该路径被认为是无效的,不会返回。 - `avoid_collisions`:在计算路径时是否检查机器人与环境之间的碰撞。如果检测到碰撞,则计算出的路径将被修改以避免障碍物。 - `path_constraints`:一个`moveit_msgs.msg.Constraints`消息,指定要强制执行的计算路径上的约束条件。如果为`None`,则不使用任何约束。 - `attached_object_touch_links`:一个字符串列表,指定附加对象在运动过程允许触摸的链接。如果为`None`,则将使用`planning_scene_interface`构造函数`touch_links`参数的默认值。 - `moveit_msgs_opts`:计算路径的高级选项。这是一个键值对字典,其键是字符串,值可以是整数、浮点数或字符串。可用选项与可以在`moveit_msgs.msg.RobotTrajectory`消息设置的选项相同。 该函数的返回值为一个元组`(plan, fraction)`,其`plan`是一个`moveit_msgs.msg.RobotTrajectory`消息,描述了计算出的路径,`fraction`是介于0.0和1.0之间的浮点值,指定成功计算的路径的比例。如果`fraction`小于1.0,则返回的计划应视为无效。 该函数通过计算机器人末端执行器的直线或圆弧路径,生成一条路径,将机器人从起始点运动到目标点。在计算路径时,可以指定一些约束条件,例如机器人与环境之间的碰撞,机器人的关节角度等。这使得计算出的路径更加精确和安全。
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值