Skip to content

Commit

Permalink
Automatically fix code style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jan 23, 2025
1 parent a306dc8 commit 779549c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/nanosaur/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,24 +72,24 @@ def docker_robot_run_command(platform, params: Params, command, name=None):
if not docker.compose.is_installed():
print(TerminalFormatter.color_text("Please install Docker and Docker Compose before running the simulation.", color='red'))
return False

workspace_type = "robot" if platform['Machine'] == 'jetson' else "simulation"
docker_compose = f"docker-compose.{workspace_type}.yml"
nanosaur_home_path = get_nanosaur_home()
# Create the full file path
docker_compose_path = os.path.join(nanosaur_home_path, docker_compose)
robot = RobotList.get_robot(params)

# Check which simulation tool is selected only if robot.simulation is true
if robot.simulation and 'simulation_tool' not in params:
print(TerminalFormatter.color_text("No simulation tool selected. Please run simulation set first.", color='red'))
return False

# Build env file
if not is_env_file():
print(TerminalFormatter.color_text("Creating the environment file...", color='green'))
build_env_file(params)

# Create a DockerClient object with the docker-compose file
nanosaur_compose = DockerClient(compose_files=[docker_compose_path])
try:
Expand Down
3 changes: 2 additions & 1 deletion src/nanosaur/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def control_keyboard(platform, params: Params, args):
robot = RobotList.get_robot(params)
command = f"ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args --remap /cmd_vel:=/{robot.name}/key_vel"
# Run from local machine
if params.get('mode', '') in ['Maintainer','Raffo']:
if params.get('mode', '') in ['Maintainer', 'Raffo']:
nanosaur_ws_path = workspace.get_workspace_path(params, 'ws_simulation_name')
bash_file = f'{nanosaur_ws_path}/install/setup.bash'
# Read the robot name
Expand All @@ -287,6 +287,7 @@ def control_keyboard(platform, params: Params, args):
docker.docker_robot_run_command(platform, params, shlex.split(command), name=f"{robot.name}-keyboard")
return True


def robot_display(platform, params: Params, args):
"""Display the robot configuration."""
robot = RobotList.get_robot(params)
Expand Down

0 comments on commit 779549c

Please sign in to comment.