{"action":"created","issue":{"url":"https://api.github.com/repos/ros2/rclcpp/issues/248","repository_url":"https://api.github.com/repos/ros2/rclcpp","labels_url":"https://api.github.com/repos/ros2/rclcpp/issues/248/labels{/name}","comments_url":"https://api.github.com/repos/ros2/rclcpp/issues/248/comments","events_url":"https://api.github.com/repos/ros2/rclcpp/issues/248/events","html_url":"https://github.com/ros2/rclcpp/issues/248","id":172832635,"number":248,"title":"Timer unreliable on ARM","user":{"login":"gerkey","id":1188842,"avatar_url":"https://avatars.githubusercontent.com/u/1188842?v=3","gravatar_id":"","url":"https://api.github.com/users/gerkey","html_url":"https://github.com/gerkey","followers_url":"https://api.github.com/users/gerkey/followers","following_url":"https://api.github.com/users/gerkey/following{/other_user}","gists_url":"https://api.github.com/users/gerkey/gists{/gist_id}","starred_url":"https://api.github.com/users/gerkey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gerkey/subscriptions","organizations_url":"https://api.github.com/users/gerkey/orgs","repos_url":"https://api.github.com/users/gerkey/repos","events_url":"https://api.github.com/users/gerkey/events{/privacy}","received_events_url":"https://api.github.com/users/gerkey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"gerkey","id":1188842,"avatar_url":"https://avatars.githubusercontent.com/u/1188842?v=3","gravatar_id":"","url":"https://api.github.com/users/gerkey","html_url":"https://github.com/gerkey","followers_url":"https://api.github.com/users/gerkey/followers","following_url":"https://api.github.com/users/gerkey/following{/other_user}","gists_url":"https://api.github.com/users/gerkey/gists{/gist_id}","starred_url":"https://api.github.com/users/gerkey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gerkey/subscriptions","organizations_url":"https://api.github.com/users/gerkey/orgs","repos_url":"https://api.github.com/users/gerkey/repos","events_url":"https://api.github.com/users/gerkey/events{/privacy}","received_events_url":"https://api.github.com/users/gerkey/received_events","type":"User","site_admin":false},"assignees":[{"login":"gerkey","id":1188842,"avatar_url":"https://avatars.githubusercontent.com/u/1188842?v=3","gravatar_id":"","url":"https://api.github.com/users/gerkey","html_url":"https://github.com/gerkey","followers_url":"https://api.github.com/users/gerkey/followers","following_url":"https://api.github.com/users/gerkey/following{/other_user}","gists_url":"https://api.github.com/users/gerkey/gists{/gist_id}","starred_url":"https://api.github.com/users/gerkey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gerkey/subscriptions","organizations_url":"https://api.github.com/users/gerkey/orgs","repos_url":"https://api.github.com/users/gerkey/repos","events_url":"https://api.github.com/users/gerkey/events{/privacy}","received_events_url":"https://api.github.com/users/gerkey/received_events","type":"User","site_admin":false}],"milestone":null,"comments":11,"created_at":"2016-08-23T23:39:47Z","updated_at":"2016-08-24T18:58:21Z","closed_at":null,"body":"When testing on an rpi3, I found that the `dynamic_bridge` wasn't working. I've tracked it down to the wall timer that's supposed to make the bridge poll the ROS2 graph not firing. I then tried the `timer_test` in `test_rclcpp` and found that it fails intermittently. I'm tempted to blame it on inadequate CPU cycles, but that's not very satisfying."},"comment":{"url":"https://api.github.com/repos/ros2/rclcpp/issues/comments/242172542","html_url":"https://github.com/ros2/rclcpp/issues/248#issuecomment-242172542","issue_url":"https://api.github.com/repos/ros2/rclcpp/issues/248","id":242172542,"user":{"login":"gerkey","id":1188842,"avatar_url":"https://avatars.githubusercontent.com/u/1188842?v=3","gravatar_id":"","url":"https://api.github.com/users/gerkey","html_url":"https://github.com/gerkey","followers_url":"https://api.github.com/users/gerkey/followers","following_url":"https://api.github.com/users/gerkey/following{/other_user}","gists_url":"https://api.github.com/users/gerkey/gists{/gist_id}","starred_url":"https://api.github.com/users/gerkey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gerkey/subscriptions","organizations_url":"https://api.github.com/users/gerkey/orgs","repos_url":"https://api.github.com/users/gerkey/repos","events_url":"https://api.github.com/users/gerkey/events{/privacy}","received_events_url":"https://api.github.com/users/gerkey/received_events","type":"User","site_admin":false},"created_at":"2016-08-24T18:58:21Z","updated_at":"2016-08-24T18:58:21Z","body":"Thanks for the test! It passes for me. But I did initially get one warning and one error during compilation:\r\n~~~\r\n/home/pi/ros2_ws/src/ros2/rcl/rcl/src/rcl/timer.c: In function ‘rcl_timer_exchange_callback’:\r\n/home/pi/ros2_ws/src/ros2/rcl/rcl/src/rcl/timer.c:201:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]\r\n   return (rcl_timer_callback_t)rcl_atomic_exchange_uintptr_t(\r\n          ^\r\n/home/pi/ros2_ws/src/ros2/rcl/rcl/src/rcl/timer.c: In function ‘_rcl_timer_set_last_call_time’:\r\n/home/pi/ros2_ws/src/ros2/rcl/rcl/src/rcl/timer.c:244:31: error: incompatible types when assigning to type ‘atomic_uint_least64_t’ from type ‘rcl_time_point_value_t’\r\n   timer->impl->last_call_time = value;\r\n                               ^\r\n~~~\r\n\r\nI fixed the error with this change:\r\n~~~\r\ndiff --git a/rcl/src/rcl/timer.c b/rcl/src/rcl/timer.c\r\nindex 1d9893a..b22d1e3 100644\r\n--- a/rcl/src/rcl/timer.c\r\n+++ b/rcl/src/rcl/timer.c\r\n@@ -241,7 +241,7 @@ _rcl_timer_set_last_call_time(rcl_timer_t * timer, rcl_time_point_value_t value)\r\n {\r\n   RCL_CHECK_ARGUMENT_FOR_NULL(timer, RCL_RET_INVALID_ARGUMENT);\r\n   RCL_CHECK_FOR_NULL_WITH_MSG(timer->impl, \"timer is invalid\", return RCL_RET_TIMER_INVALID);\r\n-  timer->impl->last_call_time = value;\r\n+  rcl_atomic_store(&timer->impl->last_call_time, value);\r\n   return RCL_RET_OK;\r\n }\r\n~~~\r\n\r\nAre these issues perhaps symptomatic of the underlying problem?\r\n\r\nAlso, I'll dig into the test, to be sure that it's testing the case that I think I'm seeing."}}
{"actor":{"display_login":"gerkey"}}