Ask Your Question

Flexbe App fails to process custom state

asked 2020-06-23 15:52:34 -0500

chives_onion gravatar image

I'm new to flexbe and am having trouble adding my own state using the app gui. I am launching the App using the following command

roslaunch flexbe_app flexbe_full.launch

The app launches successfully. When I go to the Configuration tab and show the terminal it shows the error

[State parser] Failed to process nht_flexbe_states.get_pose (name 'frame_map' is not defined)

Where the contains the following snipper

#!/usr/bin/env python

import rospy
import tf

from geometry_msgs.msg import PoseStamped

from flexbe_core import EventState, Logger
class GetAgentPose(EventState):
    get position of agent in map frame

    -- frame_map  string       name of the map tf frame

    -- frame_agent  string        name of fixed robot base frame

    #> pose_agent   PoseStamped current location of mobile agent in map frame

    <= done                      calculated transform

    <= failed                   Failed to calculate transform


    def __init__(self, frame_map, frame_agent):

        super(GetAgentPose, self).__init__(outcomes = ['done', 'failed'],
                                            output_keys = ['pose_agent'])

        self.target_frame = frame_map
        self.source_frame = frame_agent

I've noticed that the name in the error changes to reflect the variable I have in the line self.target_frame = frame_map (and not in the __init__ or the docstring). I used the tutorial to create the containing package, and the ExampleState appears as a viable option in the Statemachine editor. The issue persists after running catkin_make and restarting the app.

I'm running melodic on Ubuntu 18.04.4 with Flexbe 2.2.4

I've also noticed the following error in the terminal echo when starting the app, but I'm uncertain if it is related.

[10371:10371:0623/] Failed to parse extension manifest.
(node:10411) [DEP0025] DeprecationWarning: sys is deprecated. Use util instead.

Any pointer on what I'm doing wrong would be appreciated.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-06-26 14:58:36 -0500

chives_onion gravatar image

Turns out I had the simple mistake of mixing tab and space indentation. I converted my file to all tabs and the FlexBe App now recognizes the state as expected.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2020-06-23 15:52:34 -0500

Seen: 23 times

Last updated: Jun 26