Skip to content
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

allows for running everything with vscode task all at once as required #239

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 9 additions & 0 deletions .vscode/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# .env file in the root of the project
#CONDA ROOT PATH : full form of ~/miniconda3
CONDA_PATH=/home/tushar/miniconda3
# SPOT ROS env name
SPOT_ROS=spot_ros
# Habitat llm env name
HABITAT_LLM=habitat-llm
# Habitat LLM Repo Path
HABITAT_LLM_PATH=/home/tushar/Desktop/try2_habitat_llm/habitat-llm
27 changes: 27 additions & 0 deletions .vscode/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## What is Tasks json
Vscode allows automating launching/building of processes/code.
At the same time gives us significant control over the lifecycle of these processes.
Overall less code cluttter & launch commands.

## How to run task
Single Click on 'Terminal' in Vscode an options box will open click on the 'Run Task' option, it will show you available tasks to run you can choose from two options
1. Run Planner with Stub Spot Skillsr : Runs spot_rl_launch_local with visualizer then runs stub skill executor & then finally planner.
2. Run Planner with Real Spot Skills: Runs spot_rl_launch_local with visualizer as above but launches real hardware skill executor & then planner.

See the following images
!['Terminal' options](run_task_dialogue_screenshot.png)
<br><br><br>
!['Run Task' options](task_options.png)

## How to define planner path & spot-sim2real env names & other customizations etc.
### Important
Since habitat planner could be stored in different local paths & env names might different.
We have '.env' file in .vscode folder please open it & edit your local paths & conda env names there.

### Optional Customization of tasks.json
For more customization please edit tasks.json, for instance currently it executes 'scripts/run_react_fre_planner.sh' from habitat-llm root folder.
If you want it to run other planner script edit roughly the line 64 at appropriate place in the task labelled as 'planner'.

Currently to handle conda issues in vscode terminal environment I had to activate conda.sh & then activate particular env, adding little more steps than just running the bash <planner_scipt.sh>

Feel free to take a look at tasks.json & edit the behaviour of launching other tasks as required.
Binary file added .vscode/run_task_dialogue_screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .vscode/task_options.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
112 changes: 112 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "spot_rl_launch_local_with_ros_vis",
"type": "shell",
"command": "bash",
"args": [
"-c",
"spot_rl_launch_local && spot_rl_ros_img_vis"
],
"problemMatcher": [],
"presentation": {
"echo": true,
"reveal": "never",
"focus": true,
"panel": "dedicated",
"showReuseMessage": false,
"clear": true
}
},
{
"label": "spot_skill_executor",
"type": "shell",
"command": "bash",
"args": [
"-c",
"sleep 5 && cd ${workspaceFolder}/spot_rl_experiments/spot_rl/utils && python skill_executor.py"
],
"problemMatcher": [],
"presentation": {
"echo": true,
"reveal": "never",
"focus": true,
"panel": "dedicated",
"showReuseMessage": false,
"clear": true
}
},
{
"label": "spot_skill_stub_executor",
"type": "shell",
"command": "bash",
"args": [
"-c",
"sleep 5 && cd ${workspaceFolder}/spot_rl_experiments/spot_rl/utils && python stub_skills.py"
],
"problemMatcher": [],
"presentation": {
"echo": true,
"reveal": "never",
"focus": true,
"panel": "dedicated",
"showReuseMessage": false,
"clear": true
}
},
{
"label": "planner",
"type": "shell",
"command": "bash",
"args": [
"-c",
"sleep 5 && set -a && source ${workspaceFolder}/.vscode/.env && set +a && source $CONDA_PATH/etc/profile.d/conda.sh && conda activate $CONDA_PATH/envs/$HABITAT_LLM && cd $HABITAT_LLM_PATH/ && bash scripts/run_react_fre_planner.sh"
],
"problemMatcher": [],
"presentation": {
"echo": true,
"reveal": "never",
"focus": true,
"panel": "dedicated",
"showReuseMessage": false,
"clear": true
}
},
{
"label": "Run Planner with Real Spot Skills",
"dependsOn": [
"spot_rl_launch_local_with_ros_vis",
"spot_skill_executor",
"planner"
],
"problemMatcher": [],
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": false,
"clear": true
}
},
{
"label": "Run Planner with Stub Spot Skills",
"dependsOn": [
"spot_rl_launch_local_with_ros_vis",
"spot_skill_stub_executor",
"planner"
],
"problemMatcher": [],
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": false,
"clear": true
}
}
]
}