-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add documentation for installation and python module #27
Add documentation for installation and python module #27
Conversation
@@ -62,7 +62,7 @@ if (${BUILD_PYTHON_BINDINGS}) | |||
FILE(COPY carma_clock_py/python_wrapper_test.py DESTINATION .) | |||
add_test(NAME test_carma_clock_python_module_binding COMMAND ${PYTHON_EXECUTABLE} python_wrapper_test.py ) | |||
# set cpack depedencies | |||
set(CPACK_DEBIAN_PACKAGE_DEPENDS carma-clock-1 python3-dev) | |||
set(CPACK_DEBIAN_PACKAGE_DEPENDS python3-dev) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something I noticed. This is the carma-clock-1 package. It can't depend on itself
.def("nowInSeconds", &fwha_stol::lib::time::CarmaClock::nowInSeconds) | ||
.def("nowInMilliseconds", &fwha_stol::lib::time::CarmaClock::nowInMilliseconds) | ||
.def("update", &fwha_stol::lib::time::CarmaClock::update, py::arg("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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting changes
PYBIND11_MODULE(libcarma_clock, m) { | ||
PYBIND11_MODULE(libcarma_clock, m) | ||
{ | ||
m.doc() = R"(CARMA Time Module provides the CarmaClock object, which is a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New module documentation string.
necessary to have control over each increment in time. An example of a use | ||
case is in a simulation environment where time may progress non-linearly. | ||
The CarmaClock constructor takes a boolean parameter to indicate whether | ||
to directlzy make calls to system time or to use its internal store value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo in directlzy
# Get ubuntu distribution code name. All STOL APT debian packages are pushed to S3 bucket based on distribution codename. | ||
. /etc/lsb-release | ||
# add the STOL APT repository | ||
echo "deb [trusted=yes] http://s3.amazonaws.com/stol-apt-repository ${DISTRIB_CODENAME} main" > /etc/apt/sources.list.d/stol-apt-repository.list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I run this command, it shows this:
echo "deb [trusted=yes] http://s3.amazonaws.com/stol-apt-repository ${DISTRIB_CODENAME} main" > /etc/apt/sources.list.d/stol-apt-repository.list
bash: /etc/apt/sources.list.d/stol-apt-repository.list: Permission denied
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same with sudo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you may need to go sudo -i and then run it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh you are right. can we include that for dummies like me
TODO How the library is configured | ||
|
||
TODO Move this configuration logic into a time manager tool in a separate library. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we planning to address TODO in this PR or leave for next?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not in here. Not even sure what Rob was referring to with this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, then should we just remove it.
py::class_<fwha_stol::lib::time::CarmaClock>(m, "CarmaClock") | ||
.def(py::init<bool>(), py::arg("simulation_mode")=false) | ||
.def(py::init<bool>(), py::arg("simulation_mode") = false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optional, but apparently we can also add method documentation like this
py::class_<fwha_stol::lib::time::CarmaClock>(m, "CarmaClock")
.def(py::init<bool>(), py::arg("simulation_mode") = false)
.def("nowInSeconds", &fwha_stol::lib::time::CarmaClock::nowInSeconds, "Get current time in seconds.")
.def("nowInMilliseconds", &fwha_stol::lib::time::CarmaClock::nowInMilliseconds, "Get current time in milliseconds.")
.def("update", &fwha_stol::lib::time::CarmaClock::update, py::arg("current_time"), "Update the internal clock with the current time.")
.def("is_simulation_mode", &fwha_stol::lib::time::CarmaClock::is_simulation_mode, "Check if in simulation mode.")
.def("wait_for_initialization", &fwha_stol::lib::time::CarmaClock::wait_for_initialization, "Wait for initialization to complete ??? what does it actually do???")
.def("sleep_until", &fwha_stol::lib::time::CarmaClock::sleep_until, py::arg("future_time"), "Sleep until a specified future time. ??? does ms or s matter here???")
.def("sleep_for", &fwha_stol::lib::time::CarmaClock::sleep_for, py::arg("time_to_sleep"), "Sleep for a specified duration ??? ms or s ???.");
Quality Gate passedIssues Measures |
# Get ubuntu distribution code name. All STOL APT debian packages are pushed to S3 bucket based on distribution codename. | ||
. /etc/lsb-release | ||
# add the STOL APT repository | ||
echo "deb [trusted=yes] http://s3.amazonaws.com/stol-apt-repository ${DISTRIB_CODENAME} main" > /etc/apt/sources.list.d/stol-apt-repository.list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh you are right. can we include that for dummies like me
TODO How the library is configured | ||
|
||
TODO Move this configuration logic into a time manager tool in a separate library. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, then should we just remove it.
PR Details
Description
This PR adds documentation for installing/importing CARMA Time Library
Related GitHub Issue
Related Jira Key
Motivation and Context
For internal and external use/extension of library
How Has This Been Tested?
NA
Types of changes
Checklist: