Skip to content
Merged
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
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "third_party/args"]
path = third_party/args
url = https://github.com/Taywee/args.git
[submodule "third_party/toml11"]
path = third_party/toml11
url = https://github.com/ToruNiina/toml11.git
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@ if(APPLE)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
endif()

find_package(servoarray 0.1 REQUIRED)
find_package(servoarray 0.8 REQUIRED)
include_directories(${SERVOARRAY_INCLUDE_DIR})

find_package(flom 0.3 REQUIRED)
include_directories(${flom_INCLUDE_DIR})

include_directories(SYSTEM third_party/args)
include_directories(SYSTEM third_party/toml11)

include(cmake/compile-options.cmake)

Expand Down
20 changes: 1 addition & 19 deletions bin/runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <servoarray/servomap.h>

#include <args.hxx>
#include <toml.hpp>

static std::atomic<bool> quit(false);

Expand Down Expand Up @@ -47,8 +46,6 @@ int main(int argc, char *argv[]) {
register_signal(SIGQUIT);
register_signal(SIGTERM);

auto offsets = retrieve_offsets();

std::ifstream f(args::get(arg_motion), std::ios::binary);
auto const motion = flom::Motion::load(f);

Expand All @@ -61,7 +58,7 @@ int main(int argc, char *argv[]) {
for (auto const& [t, frame] : motion.frames(fps)) {
for (auto const& [name, pos] : frame.positions()) {
if (servos.has_name(name)) {
servos.write(name, offsets[name] + pos);
servos.write(name, pos);
} else if (!ignore_unknown) {
std::cerr << "Unknown joint \"" << name << "\"" << std::endl;
return -1;
Expand All @@ -84,18 +81,3 @@ void register_signal(int signal) {
void quit_handler(int) {
quit.store(true);
}

std::unordered_map<std::string, double> retrieve_offsets() {
const char* home = std::getenv("HOME");
if (!home) {
return {};
}

std::ifstream ifs(std::string{home} + "/.flomrunner.toml");
if (!ifs) {
return {};
}

auto const config = toml::parse(ifs);
return toml::find<std::unordered_map<std::string, double>>(config, "offsets");
}
1 change: 0 additions & 1 deletion third_party/toml11
Submodule toml11 deleted from 8c3854