Skip to content

Node name matching in giskard external_interface is not correct #329

Description

@TahaTabatabaei

Hello,

in this file:
src/pycram/external_interfaces/giskard.py, inside the wrapper() function (line 61), if statements check the name
of the node /giskard with the slash character in the string. However, the get_node_names() function returns
the names without the slash character in the name. In this case, it returns giskard instead of
/giskard.

This results in the if statements never become True, so the if statments should check the names without the slash character.

how it looks like now:

def wrapper(*args, **kwargs):

        from giskardpy.python_interface.old_python_interface import OldGiskardWrapper as GiskardWrapper
        from giskard_msgs.msg import WorldBody, MoveResult, CollisionEntry
        from geometry_msgs.msg import PoseStamped as ROSPoseStamped, PointStamped, QuaternionStamped, Vector3Stamped

        global giskard_wrapper
        global giskard_update_service
        global is_init
        if is_init and "/giskard" in get_node_names():
            return func(*args, **kwargs)
        elif is_init and "/giskard" not in get_node_names():
            logwarn("Giskard node is not available anymore, could not initialize giskard interface")
            is_init = False
            giskard_wrapper = None
            return

        if "giskard_msgs" not in sys.modules:
            logwarn("Could not initialize the Giskard interface since the giskard_msgs are not imported")
            return

        if "/giskard" in get_node_names():
            giskard_wrapper = GiskardWrapper()
            loginfo_once("Successfully initialized Giskard interface")
            is_init = True
        else:
            logwarn("Giskard is not running, could not initialize Giskard interface")
            return
        return func(*args, **kwargs)
    return wrapper

replace
if is_init and "/giskard" in get_node_names():
with
if is_init and "giskard" in get_node_names():
and
if "/giskard" in get_node_names():
with
if "giskard" in get_node_names():

I use ros2 jazzy.
The pycram was downloaded from dev branch by following the installation guide.
The giskardpy was downloaded from the giskard_library branch.

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