-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update carma-clock to compile into python module using boost python
- Loading branch information
1 parent
b15b5a8
commit 2c9b1d5
Showing
7 changed files
with
48 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,8 @@ | |
|
||
include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]") | ||
|
||
find_dependency(Boost COMPONENTS python REQUIRED ) | ||
find_dependency(Threads) | ||
find_dependency(Python3 COMPONENTS Interpreter Development) | ||
|
||
check_required_components(@PROJECT_NAME@) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
apt install libboost-python1.74-dev | ||
|
||
# TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/python3 | ||
|
||
import libcarma_clockd | ||
print("Creating Clock Object") | ||
|
||
# clock = libcarma_clockd.CarmaClock() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include <boost/python.hpp> | ||
#include <boost/python/def.hpp> | ||
#include "carma_clock.h" | ||
|
||
BOOST_PYTHON_MODULE(libcarma_clockd) { | ||
using namespace boost::python; | ||
class_<fwha_stol::lib::time::CarmaClock, boost::noncopyable>("CarmaClock", init<bool>()) | ||
.def("nowInSeconds", &fwha_stol::lib::time::CarmaClock::nowInSeconds) | ||
.def("nowInMilliseconds", &fwha_stol::lib::time::CarmaClock::nowInMilliseconds) | ||
.def("update", &fwha_stol::lib::time::CarmaClock::update,args("current_time")) | ||
.def("is_simulation_mode", &fwha_stol::lib::time::CarmaClock::is_simulation_mode) | ||
.def("wait_for_initialization",&fwha_stol::lib::time::CarmaClock::wait_for_initialization) | ||
.def("sleep_until",&fwha_stol::lib::time::CarmaClock::sleep_until,args("future_time")) | ||
.def("sleep_for",&fwha_stol::lib::time::CarmaClock::sleep_for,args("time_to_sleep")); | ||
init_module_libcarma_clockd(); | ||
} |