Skip to content

Can MoveItPy be used with rclpy.node.Node? #1017

Open
@ymollard

Description

@ymollard

Hi,

The MoveItPy tutorials do not create a rclpy.node.Node instance:

def main():
###################################################################
# MoveItPy Setup
###################################################################
rclpy.init()
logger = get_logger("moveit_py.pose_goal")
# instantiate MoveItPy instance and get planning component
panda = MoveItPy(node_name="moveit_py")
panda_arm = panda.get_planning_component("panda_arm")
logger.info("MoveItPy instance created")
###########################################################################
# Plan 1 - set states with predefined string
###########################################################################
# set plan start state using predefined state
panda_arm.set_start_state(configuration_name="ready")
# set pose goal using predefined state
panda_arm.set_goal_state(configuration_name="extended")
# plan to goal
plan_and_execute(panda, panda_arm, logger, sleep_time=3.0)

In my opinion this is somehow inconsistent with rclpy tutorials that recommand to inherit from rclpy.node.Node here:
https://docs.ros.org/en/jazzy/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Py-Publisher-And-Subscriber.html

That makes integration of MoveItPy with other rclpy tools (subscribers, services, ...) more complicated for beginners who cannot rely on official ROS 2 tutorials to assemble with MoveItPy.

Is there a recommanded way to use the MoveItPy + rclpy.node.Node combo?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions