Skip to content

Commit d35ae80

Browse files
committed
Updated repo layout
1 parent 4d4b6c1 commit d35ae80

File tree

240 files changed

+33
-5022
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

240 files changed

+33
-5022
lines changed

README.md

Lines changed: 13 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,19 @@
44
[![Format](https://github.com/kineticsystem/stepit/actions/workflows/ci-format.yml/badge.svg)](https://github.com/kineticsystem/stepit/actions/workflows/ci-format.yml)
55
[![Linters](https://github.com/kineticsystem/stepit/actions/workflows/ci-ros-lint.yml/badge.svg)](https://github.com/kineticsystem/stepit/actions/workflows/ci-ros-lint.yml)
66

7-
87
## Table of Contents
98

10-
- [Table of Contents](#table-of-contents)
11-
- [Introduction](#introduction)
12-
- [Prerequisites](#prerequisites)
13-
- [Install StepIt on the Microcontroller](#install-stepit-on-the-microcontroller)
14-
- [Install StepIt on the Local Computer](#install-stepit-on-the-local-computer)
15-
- [Setup a Project Workspace](#setup-a-project-workspace)
16-
- [Chekout the Git Repository](#chekout-the-git-repository)
17-
- [Pre-Commit Hooks](#pre-commit-hooks)
18-
- [Build the Project](#build-the-project)
19-
- [Running the Application](#running-the-application)
20-
- [How to run GitHub Actions locally](#how-to-run-github-actions-locally)
21-
9+
- [StepIt](#stepit)
10+
- [Table of Contents](#table-of-contents)
11+
- [Introduction](#introduction)
12+
- [Prerequisites](#prerequisites)
13+
- [Install StepIt on the Microcontroller](#install-stepit-on-the-microcontroller)
14+
- [Install StepIt on the Local Computer](#install-stepit-on-the-local-computer)
15+
- [Chekout the Git Repository](#chekout-the-git-repository)
16+
- [Pre-Commit Hooks](#pre-commit-hooks)
17+
- [Build the Project](#build-the-project)
18+
- [Running the Application](#running-the-application)
19+
- [How to run GitHub Actions locally](#how-to-run-github-actions-locally)
2220

2321
## Introduction
2422

@@ -50,31 +48,11 @@ If PlatformIO cannot find the Python interpreter, install the following:
5048

5149
## Install StepIt on the Local Computer
5250

53-
### Setup a Project Workspace
54-
55-
Open a terminal and run the following command to source the ROS 2 Humble installation.
56-
57-
`source /opt/ros/humble/setup.bash`
58-
59-
Create a project folder anywhere inside the home directory, for example
60-
61-
`<HOME_DIR>/stepit_ws`
62-
63-
Through the document, we will use `<STEPIT_WS>` to refer to this folder.
64-
65-
```
66-
cd ~
67-
mkdir stepit_ws
68-
cd stepit_ws
69-
```
70-
7151
### Chekout the Git Repository
7252

73-
Create a source folder and check out this git repository, including all required submodules.
53+
Check out this git repository, including all required submodules.
7454

7555
```
76-
mkdir src
77-
cd src
7856
git clone --recurse-submodules [email protected]:kineticsystem/stepit.git
7957
```
8058

@@ -101,7 +79,7 @@ pre-commit install
10179

10280
### Build the Project
10381

104-
Move into the base `<STEPIT_WS>` folder and install all required dependencies.
82+
Move into the repo and install all required dependencies.
10583

10684
```
10785
rosdep install --ignore-src --from-paths . -y -r
@@ -125,15 +103,13 @@ colcon test
125103
By default, the application runs with fake motors. Run the following commands on a terminal to start it up. This will also start up RViz.
126104

127105
```
128-
cd <STEPIT_WS>
129106
source install/setup.bash
130107
ros2 launch stepit_description robot.launch.py
131108
```
132109

133110
We can control the motors with a velocity controller or a position controller. Open a different terminal and run any of the following commands to spin up the fake motors.
134111

135112
```
136-
cd <STEPIT_WS>
137113
source install/setup.bash
138114
```
139115

docker/dock.sh

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ function build_image() {
5858
function create_container() {
5959
local name="$1"
6060
local repo_path="$2"
61+
# Convert repo_path to absolute path if it's relative
62+
repo_path=$(realpath "$repo_path")
6163
# Start the container and keep it running.
6264
docker create \
6365
--name $name \
@@ -89,7 +91,8 @@ function display_usage() {
8991
echo -e "\nUsage: ./dock.sh <container-name> <command> [options]\n
9092
Commands:
9193
build Build a container without starting it
92-
Usage: ./dock.sh container-name build path-to-repo
94+
Usage: ./dock.sh container-name build [path-to-repo]
95+
Note: If path-to-repo is omitted, current working directory is used
9396
start Start the container and open an interactive terminal
9497
Usage: ./dock.sh container-name start
9598
stop Stop the container
@@ -98,6 +101,9 @@ function display_usage() {
98101
Usage: ./dock.sh container-name clean\n"
99102
}
100103

104+
# Capture the user's current working directory before changing directories
105+
USER_PWD="$PWD"
106+
101107
cd "$(dirname "$0")"
102108

103109
# Allows any local user to connect to your X server, including the Docker container.
@@ -113,17 +119,22 @@ fi
113119
# Assign the first two arguments to descriptive variables
114120
name="$1"
115121
command="$2"
116-
shift 2 # Shift off the first two arguments
117122

118123
case "$command" in
119124
build)
120-
if [ "$#" -lt 1 ]; then
121-
echo "Missing repository path for the build command."
122-
display_usage
123-
exit 1
125+
# If a third argument exists, use it as repo_path, otherwise use user's working directory
126+
if [ "$#" -ge 3 ]; then
127+
repo_path="$3"
128+
# Handle special case of "." to mean user's current directory
129+
if [ "$repo_path" = "." ]; then
130+
repo_path="$USER_PWD"
131+
# If the path is relative, make it relative to the user's original directory
132+
elif [[ "$repo_path" != /* ]]; then
133+
repo_path="$USER_PWD/$repo_path"
134+
fi
135+
else
136+
repo_path="$USER_PWD"
124137
fi
125-
repo_path="$1"
126-
shift
127138
stop_container $name
128139
remove_container $name
129140
remove_image $name
@@ -145,14 +156,7 @@ case "$command" in
145156
remove_image $name
146157
;;
147158
*)
148-
echo "Unknown parameter: $1"
159+
echo "Unknown parameter: $command"
149160
display_usage
150161
;;
151162
esac
152-
153-
# Check for any extra unexpected arguments
154-
if [ "$#" -gt 0 ]; then
155-
echo "Unexpected arguments: $@"
156-
display_usage
157-
exit 1
158-
fi

freezer_controller/CMakeLists.txt

Lines changed: 0 additions & 153 deletions
This file was deleted.

freezer_controller/controller_plugins.xml

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)