Skip to content

Pomcp doesn't work in MOS #71

@khuechuong

Description

@khuechuong

So I wanted to run the multi_object_search with pomcp. I changed sensor from proximity to laser.

problem = MosOOPOMDP(
        robot_char,  # r is the robot character
        sigma=0.05,  # observation model parameter
        epsilon=0.95,  # observation model parameter
        grid_map=grid_map,
        sensors={robot_char: laserstr},
        prior="uniform",
        agent_has_map=True,
    )

and belief_rep to particles

def __init__(
        self,
        robot_id,
        env=None,
        grid_map=None,
        sensors=None,
        sigma=0.01,
        epsilon=1,
        belief_rep="particles",
        prior={},
        num_particles=100,
        agent_has_map=False,
    ):

at first it gave me this error:

File "/home/pomdp-py/pomdp_py/problems/multi_object_search/agent/belief.py", line 74, in initialize_belief
    return _initialize_particles_belief(
TypeError: _initialize_particles_belief() missing 1 required positional argument: 'robot_orientations'

since robot_orientations isn't used in the function, I just set it to None. Then it gave me this:

  File "/home/pomdp-py/pomdp_py/problems/multi_object_search/agent/belief.py", line 139, in _initialize_particles_belief
    init_robot_pose = list(prior[robot_id].keys())[0]
AttributeError: 'int' object has no attribute 'keys'

Now I'm not exactly sure what to do. From what I saw, when initalize_histogram_belief did it, the output of prior is {-114: {(7, 9, 0): 1.0}} while in initialize_particles_belief, the output of prior is {-114: 0}.

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