Skip to content

Commit

Permalink
Upgrade deprecated function in jazzy
Browse files Browse the repository at this point in the history
rclc_timre_init_default was replaced with rclc_timer_init_default2 in jazzy, which has a different set of parameters. The old function is now deprecated, this change gets rid of the message.
  • Loading branch information
jimmy-mcelwain committed Nov 21, 2024
1 parent 9fb138c commit a1010ef
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/CommunicationExecutor.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,19 @@ void Ros_Communication_StartExecutors(SEM_ID semCommunicationExecutorStatus)

//---------------------------------
//Create timers
#ifdef MOTOPLUS_LIBMICROROS_ROS2_IS_JAZZY
rc = rclc_timer_init_default2(&timerPingAgent, &g_microRosNodeInfo.support, RCL_MS_TO_NS(PERIOD_COMMUNICATION_PING_AGENT_MS), Ros_Communication_PingAgentConnection, true);
motoRosAssert_withMsg(rc == RCL_RET_OK, SUBCODE_FAIL_TIMER_INIT_PING, "Failed creating rclc timer (%d)", (int)rc);

rc = rclc_timer_init_default2(&timerPublishActionFeedback, &g_microRosNodeInfo.support, RCL_MS_TO_NS(g_nodeConfigSettings.action_feedback_publisher_period), Ros_Communication_PublishActionFeedback, true);
motoRosAssert_withMsg(rc == RCL_RET_OK, SUBCODE_FAIL_TIMER_INIT_ACTION_FB, "Failed creating rclc timer (%d)", (int)rc);

rc = rclc_timer_init_default2(&timerMonitorUserLanState, &g_microRosNodeInfo.support,
RCL_MS_TO_NS(PERIOD_COMMUNICATION_USERLAN_LINK_CHECK_MS),
Ros_Communication_MonitorUserLanState, true);
motoRosAssert_withMsg(rc == RCL_RET_OK, SUBCODE_FAIL_TIMER_INIT_USERLAN_MONITOR,
"Failed creating rclc timer (%d)", (int)rc);
#else
rc = rclc_timer_init_default(&timerPingAgent, &g_microRosNodeInfo.support, RCL_MS_TO_NS(PERIOD_COMMUNICATION_PING_AGENT_MS), Ros_Communication_PingAgentConnection);
motoRosAssert_withMsg(rc == RCL_RET_OK, SUBCODE_FAIL_TIMER_INIT_PING, "Failed creating rclc timer (%d)", (int)rc);

Expand All @@ -321,7 +334,7 @@ void Ros_Communication_StartExecutors(SEM_ID semCommunicationExecutorStatus)
Ros_Communication_MonitorUserLanState);
motoRosAssert_withMsg(rc == RCL_RET_OK, SUBCODE_FAIL_TIMER_INIT_USERLAN_MONITOR,
"Failed creating rclc timer (%d)", (int)rc);

#endif
//---------------------------------
//Create executors
rclc_executor_t executor_motion_control;
Expand Down

0 comments on commit a1010ef

Please sign in to comment.