ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Why ROS2 rclc_parameter_set_int() has value parameter as int64_t while rclc_parameter_get_int() has the same parameter as int type?

asked 2022-03-16 13:30:11 -0500

Jefecito gravatar image

Hello guys,

I just dealt with these two functions while I was learning how to implement a Parameter Server with Micro-ROS and ROS2 Galactic. I confess it bugged my mind, so we are talking about the same parameter value transported within a Parameter Server. Exploring the library I noticed that both functions are based on the Parameter struct, an heiress from rcl_interfaces__msg__Parameter, that has an integer_value member of int64_t type. Why don't use int64_t for the get and set functions?

Please, don't take it as criticism. I just wanna understand the reasons for this decision.

Cheers.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-03-17 01:44:42 -0500

Pablogs gravatar image
edit flag offensive delete link more

Comments

Yeah, thanks. But I saw that it could be a problem for Galactic. What kind of API incompatibility could happen?

Jefecito gravatar image Jefecito  ( 2022-03-17 07:30:54 -0500 )edit

Well, according to the C99 standard int can be anything greater than 16 bits, depending on the platform and compiler. Now we are enforcing it to be 64 bits long with int64_t... So there can be an API break.

Pablogs gravatar image Pablogs  ( 2022-03-17 08:57:01 -0500 )edit

Question Tools

3 followers

Stats

Asked: 2022-03-16 13:30:11 -0500

Seen: 69 times

Last updated: Mar 17 '22