open-rmf / fleet_adapter_ecobot

RMF Fleet adapter for integrating Gaussian Ecobot robots
7 stars 11 forks source link

Server and client dont match #13

Closed TheConstructAi closed 1 year ago

TheConstructAi commented 1 year ago

Bug report

When launching the server and the client in a simulated environment, this happens:

Other error: 404 Client Error: NOT FOUND for url: http://127.0.0.1:8080/gs-robot/real_time_data/robot_status

Required information:

Description of the bug

It seems that there is no

gs-robot/real_time_data/robot_status

In the file ' ecobot_sim_server.py' While in the EcobotClientAPI.py, exists

def current_map(self):
        url = self.prefix + f"/gs-robot/real_time_data/robot_status"
        try:
            response = requests.get(url, timeout=self.timeout)
            response.raise_for_status()
            if self.debug:
                # print(f"Response: \n {response.json()}")
                print(json.dumps(response.json(), indent=2))

            return response.json()["data"]["robotStatus"]["map"]["name"]
        except HTTPError as http_err:
            print(f"HTTP error: {http_err}")
        except Exception as err:
            print(f"Other error: {err}")
        return None

Which explains why this is not working.

Steps to reproduce the bug

Execute any simulation with the cleanerbots and execute

cd ~/ecobot_ws
source install/setup.bash
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
export PORT=8080
export NAV_GRAPH=/home/user/ecobot_ws/build/ecobot_demos_gz_classic/maps/circle/nav_graphs/0.yaml
export CONFIG_FILE=/home/user/ecobot_ws/src/ecobot_playground/ecobot_demos_gz_classic/robot_config/ecobot_config.yaml
ros2 run fleet_adapter_ecobot ecobot_sim_server -c $CONFIG_FILE -n $NAV_GRAPH -p $PORT

And

cd ~/ecobot_ws
source install/setup.bash
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
export NAV_GRAPH=/home/user/ecobot_ws/build/ecobot_demos_gz_classic/maps/circle/nav_graphs/0.yaml
export CONFIG_FILE=/home/user/ecobot_ws/src/ecobot_playground/ecobot_demos_gz_classic/robot_config/ecobot_config.yaml
ros2 run fleet_adapter_ecobot fleet_adapter_ecobot -c $CONFIG_FILE -n $NAV_GRAPH --use_sim_time -s ws://localhost:7878/_internal

I tested that this simulation works with a standard fleet_adapter given in the demos, so discarded that its related to the sim in any way,

Additional information

I don't know I there is a branch around there where this is fixed? Or do we have to make the necessary changes to make this work? Hope to hear from you people soon :)

TheConstructAi commented 1 year ago

Solved this issue through this pull request:

14