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

Rosserial client var typedef #254

Merged

Conversation

mikeodr
Copy link

@mikeodr mikeodr commented Nov 2, 2016

Updating message generation to provide a typedef for each message variable.
This allows for rosserial client applications to define a size/type variable to match that of a message.

This is already present in roscpp message headers.

An example of the newly generated typedefs in the message header:

  class Status : public ros::Msg
  {
    public:
      typedef std_msgs::Header _header_type;
      _header_type header;
      typedef const char* _hardware_id_type;
      _hardware_id_type hardware_id;
      typedef ros::Duration _mcu_uptime_type;
      _mcu_uptime_type mcu_uptime;
      typedef ros::Duration _connection_uptime_type;
      _connection_uptime_type connection_uptime;
      typedef float _pcb_temperature_type;
      _pcb_temperature_type pcb_temperature;
      typedef float _mcu_temperature_type;
      _mcu_temperature_type mcu_temperature;
      typedef float _battery_temperature_type;
      _battery_temperature_type battery_temperature;
      typedef uint16_t _stop_type;
      _stop_type stop;
      typedef float _measured_battery_type;
      _measured_battery_type measured_battery;
      typedef float _measured_12v_type;
      _measured_12v_type measured_12v;
      typedef float _measured_5v_type;
      _measured_5v_type measured_5v;
      typedef float _drive_current_type;
      _drive_current_type drive_current;
      typedef float _user_current_type;
      _user_current_type user_current;
      typedef float _computer_current_type;
      _computer_current_type computer_current;
      typedef float _total_current_type;
      _total_current_type total_current;
      uint32_t foo_length;
      typedef float _foo_type;
      _foo_type st_foo;
      _foo_type * foo;

Mike O'Driscoll added 2 commits November 2, 2016 14:09
This brings rosserial message headers in line with
roscpp headers that provide a typedef for the message
variable member.
@mikeodr
Copy link
Author

mikeodr commented Nov 2, 2016

To note: I used the same typedef naming syntax as roscpp for consistency, happy to modify if needed.

@mikeodr
Copy link
Author

mikeodr commented Nov 2, 2016

@mikepurvis FYI.

@mikepurvis
Copy link
Member

Thanks for adding the array example; that's the one I was primarily concerned about.

@mikepurvis mikepurvis merged commit 6460202 into ros-drivers:jade-devel Nov 2, 2016
@mikeodr mikeodr deleted the rosserial-client-var-typedef branch November 2, 2016 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants