Giter VIP home page Giter VIP logo

Comments (3)

dirk-thomas avatar dirk-thomas commented on August 20, 2024

The function bool Time::useSystemTime() acts as a "getter" - not as a "setter" so it is fine as it is. (Maybe not named very intuitively.)

Assuming this resolves your "problem" I will go ahead and close the ticket. Please feel free to continue commenting on it.

from roscpp_core.

sunnyroad avatar sunnyroad commented on August 20, 2024

then what's the difference between bool Time::useSystemTime() and bool Time::isSystemTime() ?
and which function to call if we want to change to using Systemtime, where is the "setter" function? Time::init() ?

from roscpp_core.

dirk-thomas avatar dirk-thomas commented on August 20, 2024

what's the difference between bool Time::useSystemTime() and bool Time::isSystemTime()?

There is none - both methods do exactly the same.

which function to call if we want to change to using Systemtime, where is the "setter" function? Time::init()?

The choice between system time and sim time is being made based on the Clock. So there is no API you expect to simply switch between them. When sim time is enabled and clock messages are received they set the time (https://github.com/ros/ros_comm/blob/6b9efd56d6882d1c017152ba11a5780a1496b30b/clients/roscpp/src/libros/init.cpp#L255-L258) which then changes the state of the clock:

void Time::setNow(const Time& new_now)
{
boost::mutex::scoped_lock lock(g_sim_time_mutex);
g_sim_time = new_now;
g_use_sim_time = true;
}

from roscpp_core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.