Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
9b1ceb0
playback.py shows rangefinder
simondlevy Feb 8, 2026
07f20ad
Use tmp worldfile file for playback
simondlevy Feb 8, 2026
776bed4
new file: webots/controllers/pycontroller/pycontroller.py
simondlevy Feb 8, 2026
59a457d
modified: pycontroller.py
simondlevy Feb 8, 2026
4bf00cd
modified: pycontroller.py
simondlevy Feb 8, 2026
b083ad5
modified: pycontroller.py
simondlevy Feb 8, 2026
25fe79a
modified: pycontroller.py
simondlevy Feb 9, 2026
fe507ff
modified: pycontroller.py
simondlevy Feb 9, 2026
5fc2dc3
modified: pycontroller.py
simondlevy Feb 9, 2026
02feba8
modified: pycontroller.py
simondlevy Feb 9, 2026
dbaf0bc
modified: pycontroller.py
simondlevy Feb 9, 2026
b3549ad
modified: pycontroller.py
simondlevy Feb 9, 2026
e32813b
modified: pycontroller.py
simondlevy Feb 9, 2026
29a42c0
modified: pycontroller.py
simondlevy Feb 9, 2026
4d2b421
modified: pycontroller.py
simondlevy Feb 9, 2026
7d00d49
=More pycontroller.py
simondlevy Feb 9, 2026
5b1d7f6
=More pycontroller.py
simondlevy Feb 9, 2026
98d008a
=More pycontroller.py
simondlevy Feb 9, 2026
f59922a
modified: pycontroller.py
simondlevy Feb 9, 2026
44a2d6b
=More pycontroller.py
simondlevy Feb 9, 2026
5c27198
=More pycontroller.py
simondlevy Feb 9, 2026
34b5717
=More pycontroller.py
simondlevy Feb 9, 2026
b6ce9e5
modified: ../../../../src/simulator/message.h
simondlevy Feb 9, 2026
d9b9156
Sim uses default logfile name
simondlevy Feb 9, 2026
3b30483
modified: main.cpp
simondlevy Feb 9, 2026
e01d9ba
Sim passes pwd, worldname as environment variables
simondlevy Feb 9, 2026
a288d8d
Cleanup
simondlevy Feb 9, 2026
1190ed7
modified: pycontroller.py
simondlevy Feb 9, 2026
ce6d5c9
modified: pycontroller.py
simondlevy Feb 9, 2026
0933ba1
=More pycontroller.py
simondlevy Feb 9, 2026
1576ef5
=More pycontroller.py
simondlevy Feb 9, 2026
ff6047e
=More pycontroller.py
simondlevy Feb 9, 2026
4128c93
=More pycontroller.py
simondlevy Feb 9, 2026
9327935
pycontroller.py flying
simondlevy Feb 9, 2026
f345c22
Cleanup
simondlevy Feb 9, 2026
1eeef55
modified: kicad/teensy2-bottom-bmi088/teensy2-bottom-bmi088.kicad_pcb
simondlevy Feb 10, 2026
9d3f186
modified: pycontroller.py
simondlevy Feb 10, 2026
ab9e948
renamed: webots/controllers/pycontroller/pycontroller.py -> webots…
simondlevy Feb 10, 2026
a5a3489
deleted: src/simulator/message.h
simondlevy Feb 10, 2026
3897d8c
modified: kicad/teensy2-bottom-small/teensy2-bottom-small.kicad_pcb
simondlevy Feb 10, 2026
54b4e1c
modified: kicad/teensy2-bottom-small/teensy2-bottom-small.kicad_pcb
levyswluedu Feb 10, 2026
80eb015
Eliminating returned structures
simondlevy Feb 10, 2026
1211c3f
More tests
simondlevy Feb 10, 2026
d64d569
Upgraded project to C++17 which supports inline variables
teddy-ross Feb 12, 2026
a50a72c
Add Python dependencies for simtest playback
teddy-ross Feb 12, 2026
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
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#auto_saved_files
#__pycache__/
__pycache__/
*.swp
__*__.*
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http:--www.gnu.org/licenses/>.

# Command-line variables; e.g. make run world=maze ---------------------------
# Command-line variable; e.g. make run world=twoexit ------------------------
world = simple
poselogname = poselog.csv
setpointlogname = setpointlog.csv
# ----------------------------------------------------------------------------

EXE = $(shell basename "`pwd`")

Expand All @@ -42,12 +39,14 @@ USE_C_API = true

VERBOSE = 1

run:
sed 's/#physics/physics/' $(WORLDS_DIR)/$(world).wbt > $(WORLDS_DIR)/tmp.wbt
webots $(WORLDS_DIR)/tmp.wbt &
/usr/local/webots/webots-controller --stdout-redirect $(EXE) $(world) \
$(poselogname) $(setpointlogname)
# https://stackoverflow.com/a/49524393
.EXPORT_ALL_VARIABLES:
WEBOTS_WORLD = $(world)
WEBOTS_PATH = $(shell pwd)

run:
webots $(WORLDS_DIR)/$(world).wbt &
/usr/local/webots/webots-controller --stdout-redirect $(EXE) $(world)

edit:
vim main.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@
along with this program. If not, see <http:--www.gnu.org/licenses/>.
*/

// C/C++
// C
#include <unistd.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>

// C++
#include <map>
#include <string>
using namespace std;
Expand All @@ -30,7 +33,6 @@ using namespace std;
#include <simulator/pose.h>
#include <simulator/message.h>


#include "platform.h"

typedef struct {
Expand Down Expand Up @@ -234,10 +236,8 @@ static void getSimInfoFromJoystick(hf::siminfo_t & siminfo, hf::mode_e & mode)
siminfo.setpoint.thrust = readJoystickAxis(axes.throttle);
}

int main(int argc, char ** argv)
int main()
{
(void)argc;

hf::mode_e mode = hf::MODE_IDLE;

platform_init();
Expand All @@ -251,14 +251,9 @@ int main(int argc, char ** argv)
platform_get_vehicle_psi()
};

FILE * setpointlogfp = fopen(argv[3], "w");

while (true) {

hf::siminfo_t siminfo = {};
strcpy(siminfo.path, getcwd(siminfo.path, sizeof(siminfo.path)));
strcpy(siminfo.worldname, argv[1]);
strcpy(siminfo.poselogname, argv[2]);

if (!platform_step()) {
break;
Expand Down Expand Up @@ -289,16 +284,8 @@ int main(int argc, char ** argv)
memcpy(&siminfo.startingPose, &startingPose, sizeof(hf::pose_t));
siminfo.framerate = platform_get_framerate();
platform_send_siminfo(&siminfo, sizeof(siminfo));

// Save mode and setpoint to logfile
const auto sp = siminfo.setpoint;
fprintf(setpointlogfp, "%d,%f,%f,%f,%f\n",
siminfo.mode, sp.thrust, sp.roll, sp.pitch, sp.yaw);

}

fclose(setpointlogfp);

platform_cleanup();

return 0;
Expand Down
72 changes: 0 additions & 72 deletions attic/webots/controllers/controller/Makefile

This file was deleted.

Loading