Skip to content
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

Some bug fixes found during integration at Bit-Bots #4

Closed
Closed
Changes from 1 commit
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
Prev Previous commit
Fix misscaled time
Flova committed Jan 1, 2023
commit 5bf8a7d83e10e6464571ee01f3ac4097b632c405
5 changes: 4 additions & 1 deletion src/ros_bridge/src/webots_controller.cpp
Original file line number Diff line number Diff line change
@@ -102,7 +102,10 @@ class WebotsController : public rclcpp::Node {
client->sendRequest(request);
SensorMeasurements sensors = client->receive();
auto clk = rosgraph_msgs::msg::Clock();
clk.clock = rclcpp::Time(sensors.time());
int time = sensors.time(); // Time in ms
clk.clock.sec = time / 1000;
clk.clock.nanosec = (time % 1000) * 1000000;

clock_publisher_->publish(clk);
publishImage(sensors);
publishSensors(sensors);