magazino / move_base_flex

Move Base Flex: a backwards-compatible replacement for move_base
https://uos.github.io/mbf_docs/
BSD 3-Clause "New" or "Revised" License
429 stars 154 forks source link

AttributeError: 'PoseStamped' object has no attribute 'use_start_pose' #225

Closed ML-S closed 3 years ago

ML-S commented 3 years ago

I'm trying to call the get_path-Action inside a SMACH state machine. Since I have the goalpoint (_geometrymsgs/PoseStamped) stored in an array, I need to pass it to the get_path-actionServer via the goal_cb-Param of the _smachros.SimpleActionState.

Doing so, I get the following error: Screenshot from 2020-10-12 15-00-29

My code looks as follows:

sm.userdata.next_goal = [goal_as_geometry_msgs/PoseStamped_stored_in_here]
smach.StateMachine.add('GET_GLOBAL_PATH_IN_GOAL_CHECK_SM',
                                          smach_ros.SimpleActionState(
                                              '/move_base_flex/get_path',
                                              GetPathAction,
                                              result_cb = getPathCallback,
                                              goal_cb=set_goal_callback,
                                              input_keys=['next_goal', ...]),
                                          transitions={...})

with the goal_cb as:

def set_goal_callback(userdata, goal):
    if(userdata.next_goal[0]!=None):
        return userdata.next_goal[0]
    else:
        raise Exception("userdata.next_goal is empty.")

How do I have to modify my goal_cb to provide the Action with the required _use_startpose-bool and the _startpose-Pose? And furthermore, when I want to get the global path from my current position to the specified goal, do I even need to set the start_pose or does the get_path automatically plan from my current position when _use_startpose is false?

Rayman commented 3 years ago

This issue tracker is used for bugs in move_base_flex. So I think it would be better if you ask your question on https://answers.ros.org/questions/.