Skip to content

[WIP] update dummy client message format #202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: humble-devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions manager/libs/launch_world_model.py
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file cannot be changed

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The model in this file does not match the expected format by the on_launch_world function in the manager.
Since this file cannot be changed, would you suggest updating the on_launch_world function to match the stated model in this file?
@javizqh

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to change anything related to this. The only obligatory features are the world and the launch_file_path that must be both strings

Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
from dataclasses import dataclass
from typing import Optional
from typing import Optional, Union
from pydantic import BaseModel, ValidationError

# Clase de configuración utilizando Pydantic para validación


class ConfigurationModel(BaseModel):
world: str
world: Union[str, dict]
robot: Optional[Union[str, dict]] = None
launch_file_path: str

# Definición de la clase de datos
Expand Down
17 changes: 15 additions & 2 deletions test/dummyclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,27 @@ class LaunchWorldCmd(ManagerConsumerMessage):
id: str = '2'
command: str = 'launch_world'
data: ConfigurationModel = ConfigurationModel(
world='gazebo',
world = {
"world": "gazebo",
"robot": "rae",
"launch_file_path":'/opt/jderobot/Launchers/simple_circuit_followingcam.launch.py'
},
robot = {
"world": "gazebo",
"robot": "rae",
"start_pose": [0.0, 0.0, 0.05, 0.0, 0.0, 0.0], # [x, y, z, roll, pitch, yaw],
"launch_file_path":'/opt/jderobot/Launchers/simple_circuit_followingcam.launch.py'
},
launch_file_path='/opt/jderobot/Launchers/simple_circuit_followingcam.launch.py')


class LaunchPrepareViz(ManagerConsumerMessage):
id: str = '3'
command: str = 'prepare_visualization'
data: str = 'gazebo_rae'
data: str = {
"type": 'gazebo_rae',
"file": None
}

websocket.enableTrace(True)
ws = websocket.create_connection("ws://localhost:7163")
Expand Down