Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
AMRL user committed Sep 17, 2024
1 parent 3c6c61e commit 427b9af
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 17 deletions.
21 changes: 5 additions & 16 deletions robot_interface/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,17 @@ You can use this example script as a template to implement the action servers fo

## Build
To build the action messages and the CodeBotler client:
1. Navigate to the `robot_interface` subdirectory and run `catkin_make`:
```bash
cd robot_interface
catkin_make
```
1. Source the Catkin workspace setup script:
```bash
source devel/setup.bash
```
1. Optionally, add the Catkin workspace setup script to your `~/.bashrc` file to automatically source the setup script when opening a new terminal.
```bash
echo "source $(pwd)/devel/setup.bash" >> ~/.bashrc
```
- navigate to the `robot_interface` subdirectory and run `./setup_robot.sh`
- add `devel/setup.bash` source command to your `.bashrc` file (just after the source command for your ROS distribution)

## Usage
The robot-specific action server must be launched before running the deployment interface.
1. Launch your robot action server. To launch the example server:
1. Launch your robot action server. For example, for the spot amrl server:
```bash
python3 robot_interface/src/robot_server_example.py
./codebotler_amrl_impl/start_all.sh # basically roslaunch codebotler_amrl_impl start_all.launch
```
1. Launch the deployment script on the robot:
```bash
python3 codebotler_deploy.py --robot --ip <robot_ip>
python3 codebotler.py --robot --ip <robot_ip> # e.g., for spot: python3 codebotler.py --robot --ip 10.1.0.3
```
1. Open `http://<robot_ip>:8080/` in your browser to access the deployment interface.
26 changes: 25 additions & 1 deletion robot_interface/setup_robot.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
#!/bin/bash

# Exit immediately if a command exits with a non-zero status
set -e

pip install -r requirements.txt
catkin_make

# Initialize Conda in this script
eval "$(/opt/miniconda3/bin/conda shell.bash hook)" # This is the recommended way to initialize Conda in scripts
# deactivate conda env for building
if [ -z "$CONDA_DEFAULT_ENV" ]; then
echo "No Conda environment is currently active."
CURRENT_ENV=""
else
CURRENT_ENV="$CONDA_DEFAULT_ENV"
echo "Deactivating Conda environment: $CURRENT_ENV"
conda deactivate
fi
rm -rf build/ devel/ || true
catkin_make
catkin_make # sanity check
# Reactivate the previous Conda environment if it was active
if [ -z "$CURRENT_ENV" ]; then
echo "No Conda environment was previously active. Skipping activation."
else
echo "Reactivating Conda environment: $CURRENT_ENV"
conda activate "$CURRENT_ENV"
fi

0 comments on commit 427b9af

Please sign in to comment.