Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rbonghi committed Jan 26, 2025
1 parent def3668 commit 0db96f6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/nanosaur/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def info(platform, params: Params, args):
robot_list.print_all_robots(params.get('robot_idx', 0))
# Print simulation tools if they exist
print()
simulation_info(params, args.verbose)
simulation_info(platform, params, args.verbose)
# Print installed workspaces
workspaces_info(params, args.verbose)
# Print all robot configurations
Expand Down
10 changes: 6 additions & 4 deletions src/nanosaur/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
simulation_tools = {
"isaac-sim": {
"simulator": "ros2 launch isaac_sim_wrapper isaac_sim_server.launch.py",
"robot": "ros2 launch nanosaur_isaac_sim nanosaur_bridge.launch.py"
"robot": "ros2 launch nanosaur_isaac-sim nanosaur_bridge.launch.py"
},
"gazebo": {
"simulator": "ros2 launch nanosaur_gazebo gazebo.launch.py",
Expand Down Expand Up @@ -88,7 +88,7 @@ def is_simulation_tool_installed():
return bool(find_all_isaac_sim()) or is_gazebo_installed()


def simulation_info(params: Params, verbose):
def simulation_info(platform, params: Params, verbose):
"""
Print information about the installed simulation tools.
"""
Expand All @@ -100,10 +100,12 @@ def simulation_info(params: Params, verbose):
print(TerminalFormatter.color_text("Simulation:", bold=True))
if 'simulation_tool' in params:
isaac_sim_version = ""
if 'isaac_sim_path' in params:
if 'isaac_sim_path' in params and params['simulation_tool'] == 'isaac-sim':
isaac_sim_version = params['isaac_sim_path'].split("isaac-sim-")[-1] # Extract version after "isaac-sim-"
text_message = f"{TerminalFormatter.color_text(' selected:', bold=True)} {params['simulation_tool']} {isaac_sim_version}"
print(text_message)
elif platform['Machine'] != 'jetson':
print(TerminalFormatter.color_text(" No simulation tool selected", color='red'))

# Check if Isaac Sim is installed
if verbose:
Expand Down Expand Up @@ -201,7 +203,7 @@ def simulation_start_debug(simulation_ws_path, simulation_tool, isaac_sim_path=N
command = simulation_tools[simulation_tool]['simulator']
# add isaac_sim_path if available
if isaac_sim_path:
command = f"{command} isaac_sim_path:={isaac_sim_path}"
command = f"{command} isaac_sim_path:={isaac_sim_path} headless:=false"
try:
# Combine sourcing the bash file with running the command
process = subprocess.Popen(
Expand Down
3 changes: 2 additions & 1 deletion src/nanosaur/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,8 @@ def debug_simulation(params: utilities.Params, args):
# Debug locally
if selected_launcher == 'robot':
return simulation_robot_start_debug(params)
return simulation_start_debug(simulation_ws_path, selected_launcher)
isaac_sim_path = params.get('isaac_sim_path', None)
return simulation_start_debug(simulation_ws_path, selected_launcher, isaac_sim_path=isaac_sim_path)
elif selected_location == 'docker':
# Set the volumes
volumes = [
Expand Down

0 comments on commit 0db96f6

Please sign in to comment.