#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};



// Corresponds to interface_protocol__msg__Alert
/// interface_protocol/msg/Alert.msg

#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
#[derive(Clone, Debug, PartialEq, PartialOrd)]
pub struct Alert {

    // This member is not documented.
    #[allow(missing_docs)]
    pub type_: u8,

}

impl Alert {

    // This constant is not documented.
    #[allow(missing_docs)]
    pub const STARTUP: u8 = 0;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const CONFIRM: u8 = 1;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const ERROR: u8 = 2;

}


impl Default for Alert {
  fn default() -> Self {
    <Self as rosidl_runtime_rs::Message>::from_rmw_message(super::msg::rmw::Alert::default())
  }
}

impl rosidl_runtime_rs::Message for Alert {
  type RmwMsg = super::msg::rmw::Alert;

  fn into_rmw_message(msg_cow: std::borrow::Cow<'_, Self>) -> std::borrow::Cow<'_, Self::RmwMsg> {
    match msg_cow {
      std::borrow::Cow::Owned(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
        type_: msg.type_,
      }),
      std::borrow::Cow::Borrowed(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
      type_: msg.type_,
      })
    }
  }

  fn from_rmw_message(msg: Self::RmwMsg) -> Self {
    Self {
      type_: msg.type_,
    }
  }
}


// Corresponds to interface_protocol__msg__BodyVelCmd

// This struct is not documented.
#[allow(missing_docs)]

#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
#[derive(Clone, Debug, PartialEq, PartialOrd)]
pub struct BodyVelCmd {

    // This member is not documented.
    #[allow(missing_docs)]
    pub header: std_msgs::msg::Header,


    // This member is not documented.
    #[allow(missing_docs)]
    pub linear_velocity: Vec<f64>,


    // This member is not documented.
    #[allow(missing_docs)]
    pub yaw_velocity: f64,

}



impl Default for BodyVelCmd {
  fn default() -> Self {
    <Self as rosidl_runtime_rs::Message>::from_rmw_message(super::msg::rmw::BodyVelCmd::default())
  }
}

impl rosidl_runtime_rs::Message for BodyVelCmd {
  type RmwMsg = super::msg::rmw::BodyVelCmd;

  fn into_rmw_message(msg_cow: std::borrow::Cow<'_, Self>) -> std::borrow::Cow<'_, Self::RmwMsg> {
    match msg_cow {
      std::borrow::Cow::Owned(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
        header: std_msgs::msg::Header::into_rmw_message(std::borrow::Cow::Owned(msg.header)).into_owned(),
        linear_velocity: msg.linear_velocity.into(),
        yaw_velocity: msg.yaw_velocity,
      }),
      std::borrow::Cow::Borrowed(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
        header: std_msgs::msg::Header::into_rmw_message(std::borrow::Cow::Borrowed(&msg.header)).into_owned(),
        linear_velocity: msg.linear_velocity.as_slice().into(),
      yaw_velocity: msg.yaw_velocity,
      })
    }
  }

  fn from_rmw_message(msg: Self::RmwMsg) -> Self {
    Self {
      header: std_msgs::msg::Header::from_rmw_message(msg.header),
      linear_velocity: msg.linear_velocity
          .into_iter()
          .collect(),
      yaw_velocity: msg.yaw_velocity,
    }
  }
}


// Corresponds to interface_protocol__msg__GamepadKeys
/// Timestamp field using ROS2 header

#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
#[derive(Clone, Debug, PartialEq, PartialOrd)]
pub struct GamepadKeys {

    // This member is not documented.
    #[allow(missing_docs)]
    pub header: std_msgs::msg::Header,

    /// Marks whether the hardware gamepad is connected
    pub hardware_connected: bool,

    /// Digital buttons (0 = released, 1 = pressed)
    /// Fixed size array of 12 elements
    pub digital_states: [i32; 12],

    /// Analog inputs (range: -1.0 to 1.0)
    /// Fixed size array of 6 elements
    pub analog_states: [f64; 6],

}

impl GamepadKeys {

    // This constant is not documented.
    #[allow(missing_docs)]
    pub const LB: u8 = 0;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const RB: u8 = 1;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const A: u8 = 2;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const B: u8 = 3;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const X: u8 = 4;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const Y: u8 = 5;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const BACK: u8 = 6;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const START: u8 = 7;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const CROSS_X_UP: u8 = 8;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const CROSS_X_DOWN: u8 = 9;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const CROSS_Y_LEFT: u8 = 10;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const CROSS_Y_RIGHT: u8 = 11;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const LT: u8 = 0;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const RT: u8 = 1;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const LEFT_STICK_X: u8 = 2;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const LEFT_STICK_Y: u8 = 3;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const RIGHT_STICK_X: u8 = 4;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const RIGHT_STICK_Y: u8 = 5;

}


impl Default for GamepadKeys {
  fn default() -> Self {
    <Self as rosidl_runtime_rs::Message>::from_rmw_message(super::msg::rmw::GamepadKeys::default())
  }
}

impl rosidl_runtime_rs::Message for GamepadKeys {
  type RmwMsg = super::msg::rmw::GamepadKeys;

  fn into_rmw_message(msg_cow: std::borrow::Cow<'_, Self>) -> std::borrow::Cow<'_, Self::RmwMsg> {
    match msg_cow {
      std::borrow::Cow::Owned(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
        header: std_msgs::msg::Header::into_rmw_message(std::borrow::Cow::Owned(msg.header)).into_owned(),
        hardware_connected: msg.hardware_connected,
        digital_states: msg.digital_states,
        analog_states: msg.analog_states,
      }),
      std::borrow::Cow::Borrowed(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
        header: std_msgs::msg::Header::into_rmw_message(std::borrow::Cow::Borrowed(&msg.header)).into_owned(),
      hardware_connected: msg.hardware_connected,
        digital_states: msg.digital_states,
        analog_states: msg.analog_states,
      })
    }
  }

  fn from_rmw_message(msg: Self::RmwMsg) -> Self {
    Self {
      header: std_msgs::msg::Header::from_rmw_message(msg.header),
      hardware_connected: msg.hardware_connected,
      digital_states: msg.digital_states,
      analog_states: msg.analog_states,
    }
  }
}


// Corresponds to interface_protocol__msg__Heartbeat

// This struct is not documented.
#[allow(missing_docs)]

#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
#[derive(Clone, Debug, PartialEq, PartialOrd)]
pub struct Heartbeat {

    // This member is not documented.
    #[allow(missing_docs)]
    pub header: std_msgs::msg::Header,


    // This member is not documented.
    #[allow(missing_docs)]
    pub node_name: std::string::String,


    // This member is not documented.
    #[allow(missing_docs)]
    pub startup_timestamp: i64,

    /// idle, running, error, sleep
    pub node_status: std::string::String,


    // This member is not documented.
    #[allow(missing_docs)]
    pub error_code: i64,


    // This member is not documented.
    #[allow(missing_docs)]
    pub error_message: std::string::String,

}



impl Default for Heartbeat {
  fn default() -> Self {
    <Self as rosidl_runtime_rs::Message>::from_rmw_message(super::msg::rmw::Heartbeat::default())
  }
}

impl rosidl_runtime_rs::Message for Heartbeat {
  type RmwMsg = super::msg::rmw::Heartbeat;

  fn into_rmw_message(msg_cow: std::borrow::Cow<'_, Self>) -> std::borrow::Cow<'_, Self::RmwMsg> {
    match msg_cow {
      std::borrow::Cow::Owned(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
        header: std_msgs::msg::Header::into_rmw_message(std::borrow::Cow::Owned(msg.header)).into_owned(),
        node_name: msg.node_name.as_str().into(),
        startup_timestamp: msg.startup_timestamp,
        node_status: msg.node_status.as_str().into(),
        error_code: msg.error_code,
        error_message: msg.error_message.as_str().into(),
      }),
      std::borrow::Cow::Borrowed(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
        header: std_msgs::msg::Header::into_rmw_message(std::borrow::Cow::Borrowed(&msg.header)).into_owned(),
        node_name: msg.node_name.as_str().into(),
      startup_timestamp: msg.startup_timestamp,
        node_status: msg.node_status.as_str().into(),
      error_code: msg.error_code,
        error_message: msg.error_message.as_str().into(),
      })
    }
  }

  fn from_rmw_message(msg: Self::RmwMsg) -> Self {
    Self {
      header: std_msgs::msg::Header::from_rmw_message(msg.header),
      node_name: msg.node_name.to_string(),
      startup_timestamp: msg.startup_timestamp,
      node_status: msg.node_status.to_string(),
      error_code: msg.error_code,
      error_message: msg.error_message.to_string(),
    }
  }
}


// Corresponds to interface_protocol__msg__ImuInfo

// This struct is not documented.
#[allow(missing_docs)]

#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
#[derive(Clone, Debug, PartialEq, PartialOrd)]
pub struct ImuInfo {

    // This member is not documented.
    #[allow(missing_docs)]
    pub header: std_msgs::msg::Header,


    // This member is not documented.
    #[allow(missing_docs)]
    pub quaternion: geometry_msgs::msg::Quaternion,


    // This member is not documented.
    #[allow(missing_docs)]
    pub rpy: geometry_msgs::msg::Vector3,


    // This member is not documented.
    #[allow(missing_docs)]
    pub linear_acceleration: geometry_msgs::msg::Vector3,


    // This member is not documented.
    #[allow(missing_docs)]
    pub angular_velocity: geometry_msgs::msg::Vector3,

}



impl Default for ImuInfo {
  fn default() -> Self {
    <Self as rosidl_runtime_rs::Message>::from_rmw_message(super::msg::rmw::ImuInfo::default())
  }
}

impl rosidl_runtime_rs::Message for ImuInfo {
  type RmwMsg = super::msg::rmw::ImuInfo;

  fn into_rmw_message(msg_cow: std::borrow::Cow<'_, Self>) -> std::borrow::Cow<'_, Self::RmwMsg> {
    match msg_cow {
      std::borrow::Cow::Owned(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
        header: std_msgs::msg::Header::into_rmw_message(std::borrow::Cow::Owned(msg.header)).into_owned(),
        quaternion: geometry_msgs::msg::Quaternion::into_rmw_message(std::borrow::Cow::Owned(msg.quaternion)).into_owned(),
        rpy: geometry_msgs::msg::Vector3::into_rmw_message(std::borrow::Cow::Owned(msg.rpy)).into_owned(),
        linear_acceleration: geometry_msgs::msg::Vector3::into_rmw_message(std::borrow::Cow::Owned(msg.linear_acceleration)).into_owned(),
        angular_velocity: geometry_msgs::msg::Vector3::into_rmw_message(std::borrow::Cow::Owned(msg.angular_velocity)).into_owned(),
      }),
      std::borrow::Cow::Borrowed(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
        header: std_msgs::msg::Header::into_rmw_message(std::borrow::Cow::Borrowed(&msg.header)).into_owned(),
        quaternion: geometry_msgs::msg::Quaternion::into_rmw_message(std::borrow::Cow::Borrowed(&msg.quaternion)).into_owned(),
        rpy: geometry_msgs::msg::Vector3::into_rmw_message(std::borrow::Cow::Borrowed(&msg.rpy)).into_owned(),
        linear_acceleration: geometry_msgs::msg::Vector3::into_rmw_message(std::borrow::Cow::Borrowed(&msg.linear_acceleration)).into_owned(),
        angular_velocity: geometry_msgs::msg::Vector3::into_rmw_message(std::borrow::Cow::Borrowed(&msg.angular_velocity)).into_owned(),
      })
    }
  }

  fn from_rmw_message(msg: Self::RmwMsg) -> Self {
    Self {
      header: std_msgs::msg::Header::from_rmw_message(msg.header),
      quaternion: geometry_msgs::msg::Quaternion::from_rmw_message(msg.quaternion),
      rpy: geometry_msgs::msg::Vector3::from_rmw_message(msg.rpy),
      linear_acceleration: geometry_msgs::msg::Vector3::from_rmw_message(msg.linear_acceleration),
      angular_velocity: geometry_msgs::msg::Vector3::from_rmw_message(msg.angular_velocity),
    }
  }
}


// Corresponds to interface_protocol__msg__JointCommand

// This struct is not documented.
#[allow(missing_docs)]

#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
#[derive(Clone, Debug, PartialEq, PartialOrd)]
pub struct JointCommand {

    // This member is not documented.
    #[allow(missing_docs)]
    pub header: std_msgs::msg::Header,


    // This member is not documented.
    #[allow(missing_docs)]
    pub position: Vec<f64>,


    // This member is not documented.
    #[allow(missing_docs)]
    pub velocity: Vec<f64>,


    // This member is not documented.
    #[allow(missing_docs)]
    pub feed_forward_torque: Vec<f64>,


    // This member is not documented.
    #[allow(missing_docs)]
    pub torque: Vec<f64>,


    // This member is not documented.
    #[allow(missing_docs)]
    pub stiffness: Vec<f64>,


    // This member is not documented.
    #[allow(missing_docs)]
    pub damping: Vec<f64>,


    // This member is not documented.
    #[allow(missing_docs)]
    pub parallel_parser_type: u8,

}



impl Default for JointCommand {
  fn default() -> Self {
    <Self as rosidl_runtime_rs::Message>::from_rmw_message(super::msg::rmw::JointCommand::default())
  }
}

impl rosidl_runtime_rs::Message for JointCommand {
  type RmwMsg = super::msg::rmw::JointCommand;

  fn into_rmw_message(msg_cow: std::borrow::Cow<'_, Self>) -> std::borrow::Cow<'_, Self::RmwMsg> {
    match msg_cow {
      std::borrow::Cow::Owned(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
        header: std_msgs::msg::Header::into_rmw_message(std::borrow::Cow::Owned(msg.header)).into_owned(),
        position: msg.position.into(),
        velocity: msg.velocity.into(),
        feed_forward_torque: msg.feed_forward_torque.into(),
        torque: msg.torque.into(),
        stiffness: msg.stiffness.into(),
        damping: msg.damping.into(),
        parallel_parser_type: msg.parallel_parser_type,
      }),
      std::borrow::Cow::Borrowed(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
        header: std_msgs::msg::Header::into_rmw_message(std::borrow::Cow::Borrowed(&msg.header)).into_owned(),
        position: msg.position.as_slice().into(),
        velocity: msg.velocity.as_slice().into(),
        feed_forward_torque: msg.feed_forward_torque.as_slice().into(),
        torque: msg.torque.as_slice().into(),
        stiffness: msg.stiffness.as_slice().into(),
        damping: msg.damping.as_slice().into(),
      parallel_parser_type: msg.parallel_parser_type,
      })
    }
  }

  fn from_rmw_message(msg: Self::RmwMsg) -> Self {
    Self {
      header: std_msgs::msg::Header::from_rmw_message(msg.header),
      position: msg.position
          .into_iter()
          .collect(),
      velocity: msg.velocity
          .into_iter()
          .collect(),
      feed_forward_torque: msg.feed_forward_torque
          .into_iter()
          .collect(),
      torque: msg.torque
          .into_iter()
          .collect(),
      stiffness: msg.stiffness
          .into_iter()
          .collect(),
      damping: msg.damping
          .into_iter()
          .collect(),
      parallel_parser_type: msg.parallel_parser_type,
    }
  }
}


// Corresponds to interface_protocol__msg__JointMotionPlanRequest
/// Motion plan request message (via topic)
/// request_type constants

#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
#[derive(Clone, Debug, PartialEq, PartialOrd)]
pub struct JointMotionPlanRequest {

    // This member is not documented.
    #[allow(missing_docs)]
    pub request_id: i32,


    // This member is not documented.
    #[allow(missing_docs)]
    pub request_type: u8,

    /// Motion target (consistent with JointMotion.action)
    pub use_gravity_compensation: bool,

    /// Empty array means reset to default
    pub joint_indices: Vec<i32>,

    /// Target joint positions (rad)
    pub target_positions: Vec<f64>,

    /// Target joint velocities (empty for auto-planning)
    pub target_velocities: Vec<f64>,

    /// Expected execution time (s)
    pub execution_time: f64,

    /// Optional, empty array for default
    pub stiffness: Vec<f64>,

    /// Optional, empty array for default
    pub damping: Vec<f64>,

}

impl JointMotionPlanRequest {
    /// Plan and execute
    pub const REQUEST_PLAN_EXECUTE: u8 = 0;

    /// Cancel specified request_id
    pub const REQUEST_CANCEL: u8 = 1;

    /// Reset to default pose
    pub const REQUEST_RESET: u8 = 2;

}


impl Default for JointMotionPlanRequest {
  fn default() -> Self {
    <Self as rosidl_runtime_rs::Message>::from_rmw_message(super::msg::rmw::JointMotionPlanRequest::default())
  }
}

impl rosidl_runtime_rs::Message for JointMotionPlanRequest {
  type RmwMsg = super::msg::rmw::JointMotionPlanRequest;

  fn into_rmw_message(msg_cow: std::borrow::Cow<'_, Self>) -> std::borrow::Cow<'_, Self::RmwMsg> {
    match msg_cow {
      std::borrow::Cow::Owned(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
        request_id: msg.request_id,
        request_type: msg.request_type,
        use_gravity_compensation: msg.use_gravity_compensation,
        joint_indices: msg.joint_indices.into(),
        target_positions: msg.target_positions.into(),
        target_velocities: msg.target_velocities.into(),
        execution_time: msg.execution_time,
        stiffness: msg.stiffness.into(),
        damping: msg.damping.into(),
      }),
      std::borrow::Cow::Borrowed(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
      request_id: msg.request_id,
      request_type: msg.request_type,
      use_gravity_compensation: msg.use_gravity_compensation,
        joint_indices: msg.joint_indices.as_slice().into(),
        target_positions: msg.target_positions.as_slice().into(),
        target_velocities: msg.target_velocities.as_slice().into(),
      execution_time: msg.execution_time,
        stiffness: msg.stiffness.as_slice().into(),
        damping: msg.damping.as_slice().into(),
      })
    }
  }

  fn from_rmw_message(msg: Self::RmwMsg) -> Self {
    Self {
      request_id: msg.request_id,
      request_type: msg.request_type,
      use_gravity_compensation: msg.use_gravity_compensation,
      joint_indices: msg.joint_indices
          .into_iter()
          .collect(),
      target_positions: msg.target_positions
          .into_iter()
          .collect(),
      target_velocities: msg.target_velocities
          .into_iter()
          .collect(),
      execution_time: msg.execution_time,
      stiffness: msg.stiffness
          .into_iter()
          .collect(),
      damping: msg.damping
          .into_iter()
          .collect(),
    }
  }
}


// Corresponds to interface_protocol__msg__JointMotionPlanState
/// Planner status

#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
#[derive(Clone, Debug, PartialEq, PartialOrd)]
pub struct JointMotionPlanState {

    // This member is not documented.
    #[allow(missing_docs)]
    pub request_id: i32,


    // This member is not documented.
    #[allow(missing_docs)]
    pub status: u8,

    /// Progress and time
    /// 0.0~1.0, overall planning/execution progress
    pub progress: f64,

}

impl JointMotionPlanState {

    // This constant is not documented.
    #[allow(missing_docs)]
    pub const STATUS_DISABLED: u8 = 0;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const IDLE: u8 = 1;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const EXECUTING: u8 = 2;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const EXITING: u8 = 3;

}


impl Default for JointMotionPlanState {
  fn default() -> Self {
    <Self as rosidl_runtime_rs::Message>::from_rmw_message(super::msg::rmw::JointMotionPlanState::default())
  }
}

impl rosidl_runtime_rs::Message for JointMotionPlanState {
  type RmwMsg = super::msg::rmw::JointMotionPlanState;

  fn into_rmw_message(msg_cow: std::borrow::Cow<'_, Self>) -> std::borrow::Cow<'_, Self::RmwMsg> {
    match msg_cow {
      std::borrow::Cow::Owned(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
        request_id: msg.request_id,
        status: msg.status,
        progress: msg.progress,
      }),
      std::borrow::Cow::Borrowed(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
      request_id: msg.request_id,
      status: msg.status,
      progress: msg.progress,
      })
    }
  }

  fn from_rmw_message(msg: Self::RmwMsg) -> Self {
    Self {
      request_id: msg.request_id,
      status: msg.status,
      progress: msg.progress,
    }
  }
}


// Corresponds to interface_protocol__msg__JointOverrideCommand

// This struct is not documented.
#[allow(missing_docs)]

#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
#[derive(Clone, Debug, PartialEq, PartialOrd)]
pub struct JointOverrideCommand {

    // This member is not documented.
    #[allow(missing_docs)]
    pub header: std_msgs::msg::Header,


    // This member is not documented.
    #[allow(missing_docs)]
    pub weight: f64,


    // This member is not documented.
    #[allow(missing_docs)]
    pub joint_indices: Vec<i32>,


    // This member is not documented.
    #[allow(missing_docs)]
    pub position: Vec<f64>,


    // This member is not documented.
    #[allow(missing_docs)]
    pub velocity: Vec<f64>,


    // This member is not documented.
    #[allow(missing_docs)]
    pub feed_forward_torque: Vec<f64>,


    // This member is not documented.
    #[allow(missing_docs)]
    pub torque: Vec<f64>,


    // This member is not documented.
    #[allow(missing_docs)]
    pub stiffness: Vec<f64>,


    // This member is not documented.
    #[allow(missing_docs)]
    pub damping: Vec<f64>,

}



impl Default for JointOverrideCommand {
  fn default() -> Self {
    <Self as rosidl_runtime_rs::Message>::from_rmw_message(super::msg::rmw::JointOverrideCommand::default())
  }
}

impl rosidl_runtime_rs::Message for JointOverrideCommand {
  type RmwMsg = super::msg::rmw::JointOverrideCommand;

  fn into_rmw_message(msg_cow: std::borrow::Cow<'_, Self>) -> std::borrow::Cow<'_, Self::RmwMsg> {
    match msg_cow {
      std::borrow::Cow::Owned(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
        header: std_msgs::msg::Header::into_rmw_message(std::borrow::Cow::Owned(msg.header)).into_owned(),
        weight: msg.weight,
        joint_indices: msg.joint_indices.into(),
        position: msg.position.into(),
        velocity: msg.velocity.into(),
        feed_forward_torque: msg.feed_forward_torque.into(),
        torque: msg.torque.into(),
        stiffness: msg.stiffness.into(),
        damping: msg.damping.into(),
      }),
      std::borrow::Cow::Borrowed(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
        header: std_msgs::msg::Header::into_rmw_message(std::borrow::Cow::Borrowed(&msg.header)).into_owned(),
      weight: msg.weight,
        joint_indices: msg.joint_indices.as_slice().into(),
        position: msg.position.as_slice().into(),
        velocity: msg.velocity.as_slice().into(),
        feed_forward_torque: msg.feed_forward_torque.as_slice().into(),
        torque: msg.torque.as_slice().into(),
        stiffness: msg.stiffness.as_slice().into(),
        damping: msg.damping.as_slice().into(),
      })
    }
  }

  fn from_rmw_message(msg: Self::RmwMsg) -> Self {
    Self {
      header: std_msgs::msg::Header::from_rmw_message(msg.header),
      weight: msg.weight,
      joint_indices: msg.joint_indices
          .into_iter()
          .collect(),
      position: msg.position
          .into_iter()
          .collect(),
      velocity: msg.velocity
          .into_iter()
          .collect(),
      feed_forward_torque: msg.feed_forward_torque
          .into_iter()
          .collect(),
      torque: msg.torque
          .into_iter()
          .collect(),
      stiffness: msg.stiffness
          .into_iter()
          .collect(),
      damping: msg.damping
          .into_iter()
          .collect(),
    }
  }
}


// Corresponds to interface_protocol__msg__JointState

// This struct is not documented.
#[allow(missing_docs)]

#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
#[derive(Clone, Debug, PartialEq, PartialOrd)]
pub struct JointState {

    // This member is not documented.
    #[allow(missing_docs)]
    pub header: std_msgs::msg::Header,


    // This member is not documented.
    #[allow(missing_docs)]
    pub position: Vec<f64>,


    // This member is not documented.
    #[allow(missing_docs)]
    pub velocity: Vec<f64>,


    // This member is not documented.
    #[allow(missing_docs)]
    pub torque: Vec<f64>,

}



impl Default for JointState {
  fn default() -> Self {
    <Self as rosidl_runtime_rs::Message>::from_rmw_message(super::msg::rmw::JointState::default())
  }
}

impl rosidl_runtime_rs::Message for JointState {
  type RmwMsg = super::msg::rmw::JointState;

  fn into_rmw_message(msg_cow: std::borrow::Cow<'_, Self>) -> std::borrow::Cow<'_, Self::RmwMsg> {
    match msg_cow {
      std::borrow::Cow::Owned(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
        header: std_msgs::msg::Header::into_rmw_message(std::borrow::Cow::Owned(msg.header)).into_owned(),
        position: msg.position.into(),
        velocity: msg.velocity.into(),
        torque: msg.torque.into(),
      }),
      std::borrow::Cow::Borrowed(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
        header: std_msgs::msg::Header::into_rmw_message(std::borrow::Cow::Borrowed(&msg.header)).into_owned(),
        position: msg.position.as_slice().into(),
        velocity: msg.velocity.as_slice().into(),
        torque: msg.torque.as_slice().into(),
      })
    }
  }

  fn from_rmw_message(msg: Self::RmwMsg) -> Self {
    Self {
      header: std_msgs::msg::Header::from_rmw_message(msg.header),
      position: msg.position
          .into_iter()
          .collect(),
      velocity: msg.velocity
          .into_iter()
          .collect(),
      torque: msg.torque
          .into_iter()
          .collect(),
    }
  }
}


// Corresponds to interface_protocol__msg__LedControl

// This struct is not documented.
#[allow(missing_docs)]

#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
#[derive(Clone, Debug, PartialEq, PartialOrd)]
pub struct LedControl {

    // This member is not documented.
    #[allow(missing_docs)]
    pub color: u8,

}

impl LedControl {

    // This constant is not documented.
    #[allow(missing_docs)]
    pub const BLINK_RED: u8 = 1;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const BLINK_GREEN: u8 = 2;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const BLINK_BLUE: u8 = 3;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const BLINK_WHITE: u8 = 4;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const CONSTANT_ON_WHITE: u8 = 5;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const CONSTANT_ON_GREEN: u8 = 6;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const BREATHE_WHITE: u8 = 7;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const WATER_WHITE: u8 = 8;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const BREATHE_RED: u8 = 9;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const BLINK_ORANGE: u8 = 10;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const CONSTANT_ON_ORANGE: u8 = 11;

}


impl Default for LedControl {
  fn default() -> Self {
    <Self as rosidl_runtime_rs::Message>::from_rmw_message(super::msg::rmw::LedControl::default())
  }
}

impl rosidl_runtime_rs::Message for LedControl {
  type RmwMsg = super::msg::rmw::LedControl;

  fn into_rmw_message(msg_cow: std::borrow::Cow<'_, Self>) -> std::borrow::Cow<'_, Self::RmwMsg> {
    match msg_cow {
      std::borrow::Cow::Owned(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
        color: msg.color,
      }),
      std::borrow::Cow::Borrowed(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
      color: msg.color,
      })
    }
  }

  fn from_rmw_message(msg: Self::RmwMsg) -> Self {
    Self {
      color: msg.color,
    }
  }
}


// Corresponds to interface_protocol__msg__MotionState

// This struct is not documented.
#[allow(missing_docs)]

#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
#[derive(Clone, Debug, PartialEq, PartialOrd)]
pub struct MotionState {

    // This member is not documented.
    #[allow(missing_docs)]
    pub current_motion_task: std::string::String,


    // This member is not documented.
    #[allow(missing_docs)]
    pub available_transition_motions: Vec<std::string::String>,

}



impl Default for MotionState {
  fn default() -> Self {
    <Self as rosidl_runtime_rs::Message>::from_rmw_message(super::msg::rmw::MotionState::default())
  }
}

impl rosidl_runtime_rs::Message for MotionState {
  type RmwMsg = super::msg::rmw::MotionState;

  fn into_rmw_message(msg_cow: std::borrow::Cow<'_, Self>) -> std::borrow::Cow<'_, Self::RmwMsg> {
    match msg_cow {
      std::borrow::Cow::Owned(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
        current_motion_task: msg.current_motion_task.as_str().into(),
        available_transition_motions: msg.available_transition_motions
          .into_iter()
          .map(|elem| elem.as_str().into())
          .collect(),
      }),
      std::borrow::Cow::Borrowed(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
        current_motion_task: msg.current_motion_task.as_str().into(),
        available_transition_motions: msg.available_transition_motions
          .iter()
          .map(|elem| elem.as_str().into())
          .collect(),
      })
    }
  }

  fn from_rmw_message(msg: Self::RmwMsg) -> Self {
    Self {
      current_motion_task: msg.current_motion_task.to_string(),
      available_transition_motions: msg.available_transition_motions
          .into_iter()
          .map(|elem| elem.to_string())
          .collect(),
    }
  }
}


// Corresponds to interface_protocol__msg__MotionStateRequest

// This struct is not documented.
#[allow(missing_docs)]

#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
#[derive(Clone, Debug, PartialEq, PartialOrd)]
pub struct MotionStateRequest {

    // This member is not documented.
    #[allow(missing_docs)]
    pub target_motion_name: std::string::String,

}



impl Default for MotionStateRequest {
  fn default() -> Self {
    <Self as rosidl_runtime_rs::Message>::from_rmw_message(super::msg::rmw::MotionStateRequest::default())
  }
}

impl rosidl_runtime_rs::Message for MotionStateRequest {
  type RmwMsg = super::msg::rmw::MotionStateRequest;

  fn into_rmw_message(msg_cow: std::borrow::Cow<'_, Self>) -> std::borrow::Cow<'_, Self::RmwMsg> {
    match msg_cow {
      std::borrow::Cow::Owned(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
        target_motion_name: msg.target_motion_name.as_str().into(),
      }),
      std::borrow::Cow::Borrowed(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
        target_motion_name: msg.target_motion_name.as_str().into(),
      })
    }
  }

  fn from_rmw_message(msg: Self::RmwMsg) -> Self {
    Self {
      target_motion_name: msg.target_motion_name.to_string(),
    }
  }
}


// Corresponds to interface_protocol__msg__MotorCommand

// This struct is not documented.
#[allow(missing_docs)]

#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
#[derive(Clone, Debug, PartialEq, PartialOrd)]
pub struct MotorCommand {

    // This member is not documented.
    #[allow(missing_docs)]
    pub header: std_msgs::msg::Header,


    // This member is not documented.
    #[allow(missing_docs)]
    pub position: Vec<f64>,


    // This member is not documented.
    #[allow(missing_docs)]
    pub velocity: Vec<f64>,


    // This member is not documented.
    #[allow(missing_docs)]
    pub feed_forward_torque: Vec<f64>,


    // This member is not documented.
    #[allow(missing_docs)]
    pub torque: Vec<f64>,


    // This member is not documented.
    #[allow(missing_docs)]
    pub stiffness: Vec<f64>,


    // This member is not documented.
    #[allow(missing_docs)]
    pub damping: Vec<f64>,

}



impl Default for MotorCommand {
  fn default() -> Self {
    <Self as rosidl_runtime_rs::Message>::from_rmw_message(super::msg::rmw::MotorCommand::default())
  }
}

impl rosidl_runtime_rs::Message for MotorCommand {
  type RmwMsg = super::msg::rmw::MotorCommand;

  fn into_rmw_message(msg_cow: std::borrow::Cow<'_, Self>) -> std::borrow::Cow<'_, Self::RmwMsg> {
    match msg_cow {
      std::borrow::Cow::Owned(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
        header: std_msgs::msg::Header::into_rmw_message(std::borrow::Cow::Owned(msg.header)).into_owned(),
        position: msg.position.into(),
        velocity: msg.velocity.into(),
        feed_forward_torque: msg.feed_forward_torque.into(),
        torque: msg.torque.into(),
        stiffness: msg.stiffness.into(),
        damping: msg.damping.into(),
      }),
      std::borrow::Cow::Borrowed(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
        header: std_msgs::msg::Header::into_rmw_message(std::borrow::Cow::Borrowed(&msg.header)).into_owned(),
        position: msg.position.as_slice().into(),
        velocity: msg.velocity.as_slice().into(),
        feed_forward_torque: msg.feed_forward_torque.as_slice().into(),
        torque: msg.torque.as_slice().into(),
        stiffness: msg.stiffness.as_slice().into(),
        damping: msg.damping.as_slice().into(),
      })
    }
  }

  fn from_rmw_message(msg: Self::RmwMsg) -> Self {
    Self {
      header: std_msgs::msg::Header::from_rmw_message(msg.header),
      position: msg.position
          .into_iter()
          .collect(),
      velocity: msg.velocity
          .into_iter()
          .collect(),
      feed_forward_torque: msg.feed_forward_torque
          .into_iter()
          .collect(),
      torque: msg.torque
          .into_iter()
          .collect(),
      stiffness: msg.stiffness
          .into_iter()
          .collect(),
      damping: msg.damping
          .into_iter()
          .collect(),
    }
  }
}


// Corresponds to interface_protocol__msg__MotorDebug

// This struct is not documented.
#[allow(missing_docs)]

#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
#[derive(Clone, Debug, PartialEq, PartialOrd)]
pub struct MotorDebug {

    // This member is not documented.
    #[allow(missing_docs)]
    pub mos_temperature: Vec<f32>,


    // This member is not documented.
    #[allow(missing_docs)]
    pub motor_temperature: Vec<f32>,


    // This member is not documented.
    #[allow(missing_docs)]
    pub voltage: Vec<f32>,


    // This member is not documented.
    #[allow(missing_docs)]
    pub current: Vec<f32>,


    // This member is not documented.
    #[allow(missing_docs)]
    pub error_code: Vec<i32>,


    // This member is not documented.
    #[allow(missing_docs)]
    pub offline: Vec<u8>,


    // This member is not documented.
    #[allow(missing_docs)]
    pub enable: Vec<u8>,

}



impl Default for MotorDebug {
  fn default() -> Self {
    <Self as rosidl_runtime_rs::Message>::from_rmw_message(super::msg::rmw::MotorDebug::default())
  }
}

impl rosidl_runtime_rs::Message for MotorDebug {
  type RmwMsg = super::msg::rmw::MotorDebug;

  fn into_rmw_message(msg_cow: std::borrow::Cow<'_, Self>) -> std::borrow::Cow<'_, Self::RmwMsg> {
    match msg_cow {
      std::borrow::Cow::Owned(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
        mos_temperature: msg.mos_temperature.into(),
        motor_temperature: msg.motor_temperature.into(),
        voltage: msg.voltage.into(),
        current: msg.current.into(),
        error_code: msg.error_code.into(),
        offline: msg.offline.into(),
        enable: msg.enable.into(),
      }),
      std::borrow::Cow::Borrowed(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
        mos_temperature: msg.mos_temperature.as_slice().into(),
        motor_temperature: msg.motor_temperature.as_slice().into(),
        voltage: msg.voltage.as_slice().into(),
        current: msg.current.as_slice().into(),
        error_code: msg.error_code.as_slice().into(),
        offline: msg.offline.as_slice().into(),
        enable: msg.enable.as_slice().into(),
      })
    }
  }

  fn from_rmw_message(msg: Self::RmwMsg) -> Self {
    Self {
      mos_temperature: msg.mos_temperature
          .into_iter()
          .collect(),
      motor_temperature: msg.motor_temperature
          .into_iter()
          .collect(),
      voltage: msg.voltage
          .into_iter()
          .collect(),
      current: msg.current
          .into_iter()
          .collect(),
      error_code: msg.error_code
          .into_iter()
          .collect(),
      offline: msg.offline
          .into_iter()
          .collect(),
      enable: msg.enable
          .into_iter()
          .collect(),
    }
  }
}


// Corresponds to interface_protocol__msg__MotorState

// This struct is not documented.
#[allow(missing_docs)]

#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
#[derive(Clone, Debug, PartialEq, PartialOrd)]
pub struct MotorState {

    // This member is not documented.
    #[allow(missing_docs)]
    pub header: std_msgs::msg::Header,


    // This member is not documented.
    #[allow(missing_docs)]
    pub position: Vec<f64>,


    // This member is not documented.
    #[allow(missing_docs)]
    pub velocity: Vec<f64>,


    // This member is not documented.
    #[allow(missing_docs)]
    pub torque: Vec<f64>,

}



impl Default for MotorState {
  fn default() -> Self {
    <Self as rosidl_runtime_rs::Message>::from_rmw_message(super::msg::rmw::MotorState::default())
  }
}

impl rosidl_runtime_rs::Message for MotorState {
  type RmwMsg = super::msg::rmw::MotorState;

  fn into_rmw_message(msg_cow: std::borrow::Cow<'_, Self>) -> std::borrow::Cow<'_, Self::RmwMsg> {
    match msg_cow {
      std::borrow::Cow::Owned(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
        header: std_msgs::msg::Header::into_rmw_message(std::borrow::Cow::Owned(msg.header)).into_owned(),
        position: msg.position.into(),
        velocity: msg.velocity.into(),
        torque: msg.torque.into(),
      }),
      std::borrow::Cow::Borrowed(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
        header: std_msgs::msg::Header::into_rmw_message(std::borrow::Cow::Borrowed(&msg.header)).into_owned(),
        position: msg.position.as_slice().into(),
        velocity: msg.velocity.as_slice().into(),
        torque: msg.torque.as_slice().into(),
      })
    }
  }

  fn from_rmw_message(msg: Self::RmwMsg) -> Self {
    Self {
      header: std_msgs::msg::Header::from_rmw_message(msg.header),
      position: msg.position
          .into_iter()
          .collect(),
      velocity: msg.velocity
          .into_iter()
          .collect(),
      torque: msg.torque
          .into_iter()
          .collect(),
    }
  }
}


// Corresponds to interface_protocol__msg__ParallelParserType

// This struct is not documented.
#[allow(missing_docs)]

#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
#[derive(Clone, Debug, PartialEq, PartialOrd)]
pub struct ParallelParserType {

    // This member is not documented.
    #[allow(missing_docs)]
    pub structure_needs_at_least_one_member: u8,

}

impl ParallelParserType {

    // This constant is not documented.
    #[allow(missing_docs)]
    pub const CLASSIC_PARSER: u8 = 0;


    // This constant is not documented.
    #[allow(missing_docs)]
    pub const RL_PARSER: u8 = 1;

}


impl Default for ParallelParserType {
  fn default() -> Self {
    <Self as rosidl_runtime_rs::Message>::from_rmw_message(super::msg::rmw::ParallelParserType::default())
  }
}

impl rosidl_runtime_rs::Message for ParallelParserType {
  type RmwMsg = super::msg::rmw::ParallelParserType;

  fn into_rmw_message(msg_cow: std::borrow::Cow<'_, Self>) -> std::borrow::Cow<'_, Self::RmwMsg> {
    match msg_cow {
      std::borrow::Cow::Owned(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
        structure_needs_at_least_one_member: msg.structure_needs_at_least_one_member,
      }),
      std::borrow::Cow::Borrowed(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
      structure_needs_at_least_one_member: msg.structure_needs_at_least_one_member,
      })
    }
  }

  fn from_rmw_message(msg: Self::RmwMsg) -> Self {
    Self {
      structure_needs_at_least_one_member: msg.structure_needs_at_least_one_member,
    }
  }
}


// Corresponds to interface_protocol__msg__PowerInfo

// This struct is not documented.
#[allow(missing_docs)]

#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
#[derive(Clone, Debug, PartialEq, PartialOrd)]
pub struct PowerInfo {

    // This member is not documented.
    #[allow(missing_docs)]
    pub enable: bool,


    // This member is not documented.
    #[allow(missing_docs)]
    pub percentage: f32,


    // This member is not documented.
    #[allow(missing_docs)]
    pub voltage: f32,


    // This member is not documented.
    #[allow(missing_docs)]
    pub current: f32,


    // This member is not documented.
    #[allow(missing_docs)]
    pub current_limit: f32,


    // This member is not documented.
    #[allow(missing_docs)]
    pub error_code: i32,

}



impl Default for PowerInfo {
  fn default() -> Self {
    <Self as rosidl_runtime_rs::Message>::from_rmw_message(super::msg::rmw::PowerInfo::default())
  }
}

impl rosidl_runtime_rs::Message for PowerInfo {
  type RmwMsg = super::msg::rmw::PowerInfo;

  fn into_rmw_message(msg_cow: std::borrow::Cow<'_, Self>) -> std::borrow::Cow<'_, Self::RmwMsg> {
    match msg_cow {
      std::borrow::Cow::Owned(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
        enable: msg.enable,
        percentage: msg.percentage,
        voltage: msg.voltage,
        current: msg.current,
        current_limit: msg.current_limit,
        error_code: msg.error_code,
      }),
      std::borrow::Cow::Borrowed(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
      enable: msg.enable,
      percentage: msg.percentage,
      voltage: msg.voltage,
      current: msg.current,
      current_limit: msg.current_limit,
      error_code: msg.error_code,
      })
    }
  }

  fn from_rmw_message(msg: Self::RmwMsg) -> Self {
    Self {
      enable: msg.enable,
      percentage: msg.percentage,
      voltage: msg.voltage,
      current: msg.current,
      current_limit: msg.current_limit,
      error_code: msg.error_code,
    }
  }
}


// Corresponds to interface_protocol__msg__Tts
/// Must, Speech content

#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
#[derive(Clone, Debug, PartialEq, PartialOrd)]
pub struct Tts {

    // This member is not documented.
    #[allow(missing_docs)]
    pub text: std::string::String,

    /// Optional, Default: en
    pub language: std::string::String,

    /// Optional, Default: default
    pub speaker: std::string::String,

    /// Optional, Default: 150
    pub rate: i64,

}



impl Default for Tts {
  fn default() -> Self {
    <Self as rosidl_runtime_rs::Message>::from_rmw_message(super::msg::rmw::Tts::default())
  }
}

impl rosidl_runtime_rs::Message for Tts {
  type RmwMsg = super::msg::rmw::Tts;

  fn into_rmw_message(msg_cow: std::borrow::Cow<'_, Self>) -> std::borrow::Cow<'_, Self::RmwMsg> {
    match msg_cow {
      std::borrow::Cow::Owned(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
        text: msg.text.as_str().into(),
        language: msg.language.as_str().into(),
        speaker: msg.speaker.as_str().into(),
        rate: msg.rate,
      }),
      std::borrow::Cow::Borrowed(msg) => std::borrow::Cow::Owned(Self::RmwMsg {
        text: msg.text.as_str().into(),
        language: msg.language.as_str().into(),
        speaker: msg.speaker.as_str().into(),
      rate: msg.rate,
      })
    }
  }

  fn from_rmw_message(msg: Self::RmwMsg) -> Self {
    Self {
      text: msg.text.to_string(),
      language: msg.language.to_string(),
      speaker: msg.speaker.to_string(),
      rate: msg.rate,
    }
  }
}


