├── RBSManager ├── Assets │ └── .gitkeep └── Classes │ ├── .gitkeep │ ├── Messages │ ├── StdSrvs │ │ └── EmptyMessage.swift │ ├── Standard │ │ ├── BoolMessage.swift │ │ ├── ByteMessage.swift │ │ ├── CharMessage.swift │ │ ├── Int32Message.swift │ │ ├── UInt8Message.swift │ │ ├── Float32Message.swift │ │ ├── StringMessage.swift │ │ ├── MultiArrayDimensionMessage.swift │ │ ├── ByteMultiArrayMessage.swift │ │ ├── MultiArrayLayoutMessage.swift │ │ ├── TImeMessage.swift │ │ ├── HeaderMessage.swift │ │ └── Int8MultiArrayMessage.swift │ ├── Geographic │ │ ├── GeoPointMessage.swift │ │ ├── GeoPoseStampedMessage.swift │ │ └── GeoPoseMessage.swift │ ├── Geometry │ │ ├── PointMessage.swift │ │ ├── Vector3Message.swift │ │ ├── QuaternionMessage.swift │ │ ├── WrenchMessage.swift │ │ ├── PoseStampedMessage.swift │ │ ├── TwistStampedMessage.swift │ │ ├── TwistMessage.swift │ │ ├── PoseMessage.swift │ │ └── Vector3StampedMessage.swift │ ├── JoyMessage.swift │ ├── Turtlesim │ │ └── TeleportAbsoluteMessage.swift │ ├── Sensor │ │ ├── TemperatureMessage.swift │ │ ├── NavSatStatusMessage.swift │ │ ├── ImageMessage.swift │ │ ├── ImuMessage.swift │ │ ├── NavSatFixMessage.swift │ │ └── BatteryStateMessage.swift │ ├── Navigation │ │ └── PathMessage.swift │ ├── Ackermann │ │ ├── AckermannDriveStamped.swift │ │ └── AckermannDriveMessage.swift │ └── RBSMessage.swift │ ├── RBSMessageContainer.swift │ ├── RBSResponse.swift │ ├── RBSServiceCall.swift │ ├── RBSPublisher.swift │ └── RBSSubscriber.swift ├── _Pods.xcodeproj ├── .gitignore ├── Tools ├── custom_messages.pyc ├── msgs │ ├── std_msgs │ │ ├── EmptyMessage.swift │ │ ├── ByteMessage.swift │ │ ├── CharMessage.swift │ │ ├── TimeMessage.swift │ │ ├── Int8Message.swift │ │ ├── BoolMessage.swift │ │ ├── Int16Message.swift │ │ ├── Int32Message.swift │ │ ├── Int64Message.swift │ │ ├── StringMessage.swift │ │ ├── UInt8Message.swift │ │ ├── UInt16Message.swift │ │ ├── UInt32Message.swift │ │ ├── UInt64Message.swift │ │ ├── DurationMessage.swift │ │ ├── Float32Message.swift │ │ ├── Float64Message.swift │ │ ├── ByteMultiArrayMessage.swift │ │ ├── Int8MultiArrayMessage.swift │ │ ├── Int16MultiArrayMessage.swift │ │ ├── Int32MultiArrayMessage.swift │ │ ├── Int64MultiArrayMessage.swift │ │ ├── UInt8MultiArrayMessage.swift │ │ ├── UInt16MultiArrayMessage.swift │ │ ├── UInt32MultiArrayMessage.swift │ │ ├── UInt64MultiArrayMessage.swift │ │ ├── Float32MultiArrayMessage.swift │ │ ├── Float64MultiArrayMessage.swift │ │ ├── HeaderMessage.swift │ │ ├── MultiArrayLayoutMessage.swift │ │ ├── ColorRGBAMessage.swift │ │ └── MultiArrayDimensionMessage.swift │ ├── shape_msgs │ │ ├── PlaneMessage.swift │ │ ├── MeshTriangleMessage.swift │ │ ├── MeshMessage.swift │ │ └── SolidPrimitiveMessage.swift │ ├── actionlib_msgs │ │ ├── GoalIDMessage.swift │ │ ├── GoalStatusArrayMessage.swift │ │ └── GoalStatusMessage.swift │ ├── diagnostic_msgs │ │ ├── KeyValueMessage.swift │ │ ├── DiagnosticArrayMessage.swift │ │ └── DiagnosticStatusMessage.swift │ ├── sensor_msgs │ │ ├── LaserEchoMessage.swift │ │ ├── ChannelFloat32Message.swift │ │ ├── JoyFeedbackArrayMessage.swift │ │ ├── JoyMessage.swift │ │ ├── JoyFeedbackMessage.swift │ │ ├── TimeReferenceMessage.swift │ │ ├── RegionOfInterestMessage.swift │ │ ├── TemperatureMessage.swift │ │ ├── PointCloudMessage.swift │ │ ├── JointStateMessage.swift │ │ ├── FluidPressureMessage.swift │ │ ├── MultiDOFJointStateMessage.swift │ │ ├── CompressedImageMessage.swift │ │ ├── RelativeHumidityMessage.swift │ │ ├── PointFieldMessage.swift │ │ ├── NavSatStatusMessage.swift │ │ ├── PointCloud2Message.swift │ │ ├── ImuMessage.swift │ │ ├── ImageMessage.swift │ │ ├── IlluminanceMessage.swift │ │ ├── MagneticFieldMessage.swift │ │ ├── CameraInfoMessage.swift │ │ ├── NavSatFixMessage.swift │ │ ├── LaserScanMessage.swift │ │ ├── MultiEchoLaserScanMessage.swift │ │ ├── RangeMessage.swift │ │ └── BatteryStateMessage.swift │ ├── geometry_msgs │ │ ├── PointMessage.swift │ │ ├── Point32Message.swift │ │ ├── Vector3Message.swift │ │ ├── Pose2DMessage.swift │ │ ├── QuaternionMessage.swift │ │ ├── PolygonMessage.swift │ │ ├── PoseStampedMessage.swift │ │ ├── WrenchMessage.swift │ │ ├── AccelMessage.swift │ │ ├── TwistMessage.swift │ │ ├── AccelStampedMessage.swift │ │ ├── TwistStampedMessage.swift │ │ ├── PointStampedMessage.swift │ │ ├── PoseWithCovarianceMessage.swift │ │ ├── WrenchStampedMessage.swift │ │ ├── AccelWithCovarianceMessage.swift │ │ ├── PoseArrayMessage.swift │ │ ├── TwistWithCovarianceMessage.swift │ │ ├── Vector3StampedMessage.swift │ │ ├── InertiaStampedMessage.swift │ │ ├── PolygonStampedMessage.swift │ │ ├── PoseMessage.swift │ │ ├── TransformMessage.swift │ │ ├── QuaternionStampedMessage.swift │ │ ├── PoseWithCovarianceStampedMessage.swift │ │ ├── AccelWithCovarianceStampedMessage.swift │ │ ├── TwistWithCovarianceStampedMessage.swift │ │ ├── TransformStampedMessage.swift │ │ └── InertiaMessage.swift │ ├── visualization_msgs │ │ ├── MarkerArrayMessage.swift │ │ ├── InteractiveMarkerPoseMessage.swift │ │ ├── InteractiveMarkerInitMessage.swift │ │ ├── MenuEntryMessage.swift │ │ ├── InteractiveMarkerMessage.swift │ │ ├── InteractiveMarkerUpdateMessage.swift │ │ ├── InteractiveMarkerFeedbackMessage.swift │ │ ├── ImageMarkerMessage.swift │ │ ├── InteractiveMarkerControlMessage.swift │ │ └── MarkerMessage.swift │ ├── nav_msgs │ │ ├── PathMessage.swift │ │ ├── OccupancyGridMessage.swift │ │ ├── GridCellsMessage.swift │ │ ├── MapMetaDataMessage.swift │ │ └── OdometryMessage.swift │ ├── trajectory_msgs │ │ ├── JointTrajectoryPointMessage.swift │ │ ├── JointTrajectoryMessage.swift │ │ ├── MultiDOFJointTrajectoryMessage.swift │ │ └── MultiDOFJointTrajectoryPointMessage.swift │ └── stereo_msgs │ │ └── DisparityImageMessage.swift ├── BlankMessage.swift ├── custom_messages.py └── sync_messages.py ├── Example ├── RBSManager │ ├── Images.xcassets │ │ ├── Contents.json │ │ ├── turtleIcon.imageset │ │ │ ├── turtleIcon.png │ │ │ ├── turtleIcon@2x.png │ │ │ └── Contents.json │ │ ├── up_icon.imageset │ │ │ ├── icons8-up_circular.png │ │ │ ├── icons8-up_circular-1.png │ │ │ └── Contents.json │ │ ├── down_icon.imageset │ │ │ ├── icons8-down_circular.png │ │ │ ├── icons8-down_circular-1.png │ │ │ └── Contents.json │ │ ├── left_icon.imageset │ │ │ ├── icons8-left_circular.png │ │ │ ├── icons8-left_circular-1.png │ │ │ └── Contents.json │ │ ├── right_icon.imageset │ │ │ ├── icons8-right_circular-1.png │ │ │ ├── icons8-right_circular.png │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ ├── AppDelegate.swift │ ├── Base.lproj │ │ └── LaunchScreen.xib │ ├── ColorPickerView.swift │ └── ModalContainerView.swift ├── Podfile ├── RBSManager.xcodeproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── RBSManager-Example.xcscheme ├── RBSManager.xcworkspace │ ├── xcuserdata │ │ └── wesgoodhoofd.xcuserdatad │ │ │ └── IDEFindNavigatorScopes.plist │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── Podfile.lock └── Tests │ ├── Info.plist │ └── Tests.swift ├── JoyMessage.swift ├── Package.swift ├── Ackermann ├── AckermannDriveStamped.swift └── AckermannDriveMessage.swift ├── LICENSE ├── RBSManager.podspec └── README.md /RBSManager/Assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /RBSManager/Classes/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_Pods.xcodeproj: -------------------------------------------------------------------------------- 1 | Example/Pods/Pods.xcodeproj -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Example/Pods 2 | Example/build/Pods.build 3 | IDEWorkspaceChecks.plist 4 | -------------------------------------------------------------------------------- /Tools/custom_messages.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesgood/RBSManager/HEAD/Tools/custom_messages.pyc -------------------------------------------------------------------------------- /Example/RBSManager/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Example/RBSManager/Images.xcassets/turtleIcon.imageset/turtleIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesgood/RBSManager/HEAD/Example/RBSManager/Images.xcassets/turtleIcon.imageset/turtleIcon.png -------------------------------------------------------------------------------- /Example/RBSManager/Images.xcassets/turtleIcon.imageset/turtleIcon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesgood/RBSManager/HEAD/Example/RBSManager/Images.xcassets/turtleIcon.imageset/turtleIcon@2x.png -------------------------------------------------------------------------------- /Example/RBSManager/Images.xcassets/up_icon.imageset/icons8-up_circular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesgood/RBSManager/HEAD/Example/RBSManager/Images.xcassets/up_icon.imageset/icons8-up_circular.png -------------------------------------------------------------------------------- /Example/RBSManager/Images.xcassets/up_icon.imageset/icons8-up_circular-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesgood/RBSManager/HEAD/Example/RBSManager/Images.xcassets/up_icon.imageset/icons8-up_circular-1.png -------------------------------------------------------------------------------- /Example/RBSManager/Images.xcassets/down_icon.imageset/icons8-down_circular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesgood/RBSManager/HEAD/Example/RBSManager/Images.xcassets/down_icon.imageset/icons8-down_circular.png -------------------------------------------------------------------------------- /Example/RBSManager/Images.xcassets/left_icon.imageset/icons8-left_circular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesgood/RBSManager/HEAD/Example/RBSManager/Images.xcassets/left_icon.imageset/icons8-left_circular.png -------------------------------------------------------------------------------- /Example/RBSManager/Images.xcassets/down_icon.imageset/icons8-down_circular-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesgood/RBSManager/HEAD/Example/RBSManager/Images.xcassets/down_icon.imageset/icons8-down_circular-1.png -------------------------------------------------------------------------------- /Example/RBSManager/Images.xcassets/left_icon.imageset/icons8-left_circular-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesgood/RBSManager/HEAD/Example/RBSManager/Images.xcassets/left_icon.imageset/icons8-left_circular-1.png -------------------------------------------------------------------------------- /Example/RBSManager/Images.xcassets/right_icon.imageset/icons8-right_circular-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesgood/RBSManager/HEAD/Example/RBSManager/Images.xcassets/right_icon.imageset/icons8-right_circular-1.png -------------------------------------------------------------------------------- /Example/RBSManager/Images.xcassets/right_icon.imageset/icons8-right_circular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wesgood/RBSManager/HEAD/Example/RBSManager/Images.xcassets/right_icon.imageset/icons8-right_circular.png -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | use_frameworks! 2 | platform :ios, '10.0' 3 | 4 | target 'RBSManager_Example' do 5 | pod 'RBSManager', :path => '../' 6 | 7 | target 'RBSManager_Tests' do 8 | inherit! :search_paths 9 | 10 | 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /Example/RBSManager.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/StdSrvs/EmptyMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EmptyMessage.swift 3 | // RBSManager 4 | // 5 | // Created by Wes Goodhoofd on 2018-01-10. 6 | // 7 | 8 | import UIKit 9 | 10 | public class EmptyMessage: RBSMessage { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /Example/RBSManager.xcworkspace/xcuserdata/wesgoodhoofd.xcuserdatad/IDEFindNavigatorScopes.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Example/RBSManager.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/RBSManager.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Tools/msgs/std_msgs/EmptyMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EmptyMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class EmptyMessage: RBSMessage { 11 | 12 | 13 | 14 | public override func mapping(map: Map) { 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Tools/BlankMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // [class_name].swift 3 | // 4 | // Created by [author] on [date]. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class [class_name]: RBSMessage { 11 | [variables] 12 | [init] 13 | 14 | public override func mapping(map: Map) { 15 | [mapping] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Tools/msgs/std_msgs/ByteMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ByteMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class ByteMessage: RBSMessage { 11 | public var data: byte 12 | 13 | 14 | public override func mapping(map: Map) { 15 | data <- map["data"] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Tools/msgs/std_msgs/CharMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CharMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class CharMessage: RBSMessage { 11 | public var data: char 12 | 13 | 14 | public override func mapping(map: Map) { 15 | data <- map["data"] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Tools/msgs/std_msgs/TimeMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TimeMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class TimeMessage: RBSMessage { 11 | public var data: time 12 | 13 | 14 | public override func mapping(map: Map) { 15 | data <- map["data"] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Tools/msgs/std_msgs/Int8Message.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Int8Message.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class Int8Message: RBSMessage { 11 | public var data: int8 = 0 12 | 13 | 14 | public override func mapping(map: Map) { 15 | data <- map["data"] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Tools/msgs/std_msgs/BoolMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BoolMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class BoolMessage: RBSMessage { 11 | public var data: bool = false 12 | 13 | 14 | public override func mapping(map: Map) { 15 | data <- map["data"] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Tools/msgs/std_msgs/Int16Message.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Int16Message.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class Int16Message: RBSMessage { 11 | public var data: int16 = 0 12 | 13 | 14 | public override func mapping(map: Map) { 15 | data <- map["data"] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Tools/msgs/std_msgs/Int32Message.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Int32Message.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class Int32Message: RBSMessage { 11 | public var data: int32 = 0 12 | 13 | 14 | public override func mapping(map: Map) { 15 | data <- map["data"] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Tools/msgs/std_msgs/Int64Message.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Int64Message.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class Int64Message: RBSMessage { 11 | public var data: int64 = 0 12 | 13 | 14 | public override func mapping(map: Map) { 15 | data <- map["data"] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Tools/msgs/std_msgs/StringMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StringMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class StringMessage: RBSMessage { 11 | public var data: string 12 | 13 | 14 | public override func mapping(map: Map) { 15 | data <- map["data"] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Tools/msgs/std_msgs/UInt8Message.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UInt8Message.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class UInt8Message: RBSMessage { 11 | public var data: uint8 = 0 12 | 13 | 14 | public override func mapping(map: Map) { 15 | data <- map["data"] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Tools/msgs/std_msgs/UInt16Message.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UInt16Message.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class UInt16Message: RBSMessage { 11 | public var data: uint16 = 0 12 | 13 | 14 | public override func mapping(map: Map) { 15 | data <- map["data"] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Tools/msgs/std_msgs/UInt32Message.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UInt32Message.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class UInt32Message: RBSMessage { 11 | public var data: uint32 = 0 12 | 13 | 14 | public override func mapping(map: Map) { 15 | data <- map["data"] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Tools/msgs/std_msgs/UInt64Message.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UInt64Message.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class UInt64Message: RBSMessage { 11 | public var data: uint64 = 0 12 | 13 | 14 | public override func mapping(map: Map) { 15 | data <- map["data"] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Tools/msgs/std_msgs/DurationMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DurationMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class DurationMessage: RBSMessage { 11 | public var data: duration 12 | 13 | 14 | public override func mapping(map: Map) { 15 | data <- map["data"] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Tools/msgs/std_msgs/Float32Message.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Float32Message.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class Float32Message: RBSMessage { 11 | public var data: float32 = 0 12 | 13 | 14 | public override func mapping(map: Map) { 15 | data <- map["data"] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Tools/msgs/std_msgs/Float64Message.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Float64Message.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class Float64Message: RBSMessage { 11 | public var data: float64 = 0 12 | 13 | 14 | public override func mapping(map: Map) { 15 | data <- map["data"] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Standard/BoolMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BoolMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2018-09-19. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class BoolMessage: RBSMessage { 11 | public var data: Bool = false 12 | 13 | 14 | public override func mapping(map: Map) { 15 | data <- map["data"] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Standard/ByteMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ByteMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2018-09-19. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class ByteMessage: RBSMessage { 11 | public var data: UInt8 = 0 12 | 13 | 14 | public override func mapping(map: Map) { 15 | data <- map["data"] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Standard/CharMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CharMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2018-09-19. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class CharMessage: RBSMessage { 11 | public var data: Character? 12 | 13 | 14 | public override func mapping(map: Map) { 15 | data <- map["data"] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Standard/Int32Message.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Int32Message.swift 3 | // 4 | // Created by wesgoodhoofd on 2018-09-19. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class Int32Message: RBSMessage { 11 | public var data: Int32 = 0 12 | 13 | 14 | public override func mapping(map: Map) { 15 | data <- map["data"] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Standard/UInt8Message.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Int32Message.swift 3 | // 4 | // Created by wesgoodhoofd on 2018-09-19. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class UInt8Message: RBSMessage { 11 | public var data: UInt8 = 0 12 | 13 | public override func mapping(map: Map) { 14 | data <- map["data"] 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Tools/msgs/shape_msgs/PlaneMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PlaneMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class PlaneMessage: RBSMessage { 11 | public var coef: float64[4] = [float64[4]]() 12 | 13 | 14 | public override func mapping(map: Map) { 15 | coef <- map["coef"] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Standard/Float32Message.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Float32Message.swift 3 | // 4 | // Created by wesgoodhoofd on 2018-09-19. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class Float32Message: RBSMessage { 11 | public var data: Float32 = 0 12 | 13 | 14 | public override func mapping(map: Map) { 15 | data <- map["data"] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Standard/StringMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StringMessage.swift 3 | // Pods 4 | // 5 | // Created by Julian Gaal on 12.09.18. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | public class StringMessage: RBSMessage { 12 | public var data: String? 13 | 14 | override public func mapping(map: Map) { 15 | data <- map["data"] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Tools/msgs/actionlib_msgs/GoalIDMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GoalIDMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class GoalIDMessage: RBSMessage { 11 | public var stamp: time 12 | public var id: string 13 | 14 | 15 | public override func mapping(map: Map) { 16 | stamp <- map["stamp"] 17 | id <- map["id"] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Tools/msgs/diagnostic_msgs/KeyValueMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // KeyValueMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class KeyValueMessage: RBSMessage { 11 | public var key: string 12 | public var value: string 13 | 14 | 15 | public override func mapping(map: Map) { 16 | key <- map["key"] 17 | value <- map["value"] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Tools/msgs/shape_msgs/MeshTriangleMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MeshTriangleMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class MeshTriangleMessage: RBSMessage { 11 | public var vertex_indices: uint32[3] = [uint32[3]]() 12 | 13 | 14 | public override func mapping(map: Map) { 15 | vertex_indices <- map["vertex_indices"] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Tools/msgs/sensor_msgs/LaserEchoMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LaserEchoMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class LaserEchoMessage: RBSMessage { 11 | public var echoes: float32[] = [float32[]]() 12 | public var Each: # 13 | 14 | 15 | public override func mapping(map: Map) { 16 | echoes <- map["echoes"] 17 | Each <- map["Each"] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Tools/msgs/geometry_msgs/PointMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PointMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class PointMessage: RBSMessage { 11 | public var x: float64 = 0 12 | public var y: float64 = 0 13 | public var z: float64 = 0 14 | 15 | 16 | public override func mapping(map: Map) { 17 | x <- map["x"] 18 | y <- map["y"] 19 | z <- map["z"] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Tools/msgs/geometry_msgs/Point32Message.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Point32Message.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class Point32Message: RBSMessage { 11 | public var x: float32 = 0 12 | public var y: float32 = 0 13 | public var z: float32 = 0 14 | 15 | 16 | public override func mapping(map: Map) { 17 | x <- map["x"] 18 | y <- map["y"] 19 | z <- map["z"] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Tools/msgs/geometry_msgs/Vector3Message.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Vector3Message.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class Vector3Message: RBSMessage { 11 | public var x: float64 = 0 12 | public var y: float64 = 0 13 | public var z: float64 = 0 14 | 15 | 16 | public override func mapping(map: Map) { 17 | x <- map["x"] 18 | y <- map["y"] 19 | z <- map["z"] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Tools/msgs/sensor_msgs/ChannelFloat32Message.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ChannelFloat32Message.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class ChannelFloat32Message: RBSMessage { 11 | public var name: string 12 | public var values: float32[] = [float32[]]() 13 | 14 | 15 | public override func mapping(map: Map) { 16 | name <- map["name"] 17 | values <- map["values"] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Tools/msgs/std_msgs/ByteMultiArrayMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ByteMultiArrayMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class ByteMultiArrayMessage: RBSMessage { 11 | public var layout: MultiArrayLayout 12 | public var data: byte[] = [byte[]]() 13 | 14 | 15 | public override func mapping(map: Map) { 16 | layout <- map["layout"] 17 | data <- map["data"] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Tools/msgs/std_msgs/Int8MultiArrayMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Int8MultiArrayMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class Int8MultiArrayMessage: RBSMessage { 11 | public var layout: MultiArrayLayout 12 | public var data: int8[] = [int8[]]() 13 | 14 | 15 | public override func mapping(map: Map) { 16 | layout <- map["layout"] 17 | data <- map["data"] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Tools/msgs/std_msgs/Int16MultiArrayMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Int16MultiArrayMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class Int16MultiArrayMessage: RBSMessage { 11 | public var layout: MultiArrayLayout 12 | public var data: int16[] = [int16[]]() 13 | 14 | 15 | public override func mapping(map: Map) { 16 | layout <- map["layout"] 17 | data <- map["data"] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Tools/msgs/std_msgs/Int32MultiArrayMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Int32MultiArrayMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class Int32MultiArrayMessage: RBSMessage { 11 | public var layout: MultiArrayLayout 12 | public var data: int32[] = [int32[]]() 13 | 14 | 15 | public override func mapping(map: Map) { 16 | layout <- map["layout"] 17 | data <- map["data"] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Tools/msgs/std_msgs/Int64MultiArrayMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Int64MultiArrayMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class Int64MultiArrayMessage: RBSMessage { 11 | public var layout: MultiArrayLayout 12 | public var data: int64[] = [int64[]]() 13 | 14 | 15 | public override func mapping(map: Map) { 16 | layout <- map["layout"] 17 | data <- map["data"] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Tools/msgs/std_msgs/UInt8MultiArrayMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UInt8MultiArrayMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class UInt8MultiArrayMessage: RBSMessage { 11 | public var layout: MultiArrayLayout 12 | public var data: uint8[] = [uint8[]]() 13 | 14 | 15 | public override func mapping(map: Map) { 16 | layout <- map["layout"] 17 | data <- map["data"] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Tools/msgs/geometry_msgs/Pose2DMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Pose2DMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class Pose2DMessage: RBSMessage { 11 | public var x: float64 = 0 12 | public var y: float64 = 0 13 | public var theta: float64 = 0 14 | 15 | 16 | public override func mapping(map: Map) { 17 | x <- map["x"] 18 | y <- map["y"] 19 | theta <- map["theta"] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Tools/msgs/std_msgs/UInt16MultiArrayMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UInt16MultiArrayMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class UInt16MultiArrayMessage: RBSMessage { 11 | public var layout: MultiArrayLayout 12 | public var data: uint16[] = [uint16[]]() 13 | 14 | 15 | public override func mapping(map: Map) { 16 | layout <- map["layout"] 17 | data <- map["data"] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Tools/msgs/std_msgs/UInt32MultiArrayMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UInt32MultiArrayMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class UInt32MultiArrayMessage: RBSMessage { 11 | public var layout: MultiArrayLayout 12 | public var data: uint32[] = [uint32[]]() 13 | 14 | 15 | public override func mapping(map: Map) { 16 | layout <- map["layout"] 17 | data <- map["data"] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Tools/msgs/std_msgs/UInt64MultiArrayMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UInt64MultiArrayMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class UInt64MultiArrayMessage: RBSMessage { 11 | public var layout: MultiArrayLayout 12 | public var data: uint64[] = [uint64[]]() 13 | 14 | 15 | public override func mapping(map: Map) { 16 | layout <- map["layout"] 17 | data <- map["data"] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Tools/msgs/std_msgs/Float32MultiArrayMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Float32MultiArrayMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class Float32MultiArrayMessage: RBSMessage { 11 | public var layout: MultiArrayLayout 12 | public var data: float32[] = [float32[]]() 13 | 14 | 15 | public override func mapping(map: Map) { 16 | layout <- map["layout"] 17 | data <- map["data"] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Tools/msgs/std_msgs/Float64MultiArrayMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Float64MultiArrayMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class Float64MultiArrayMessage: RBSMessage { 11 | public var layout: MultiArrayLayout 12 | public var data: float64[] = [float64[]]() 13 | 14 | 15 | public override func mapping(map: Map) { 16 | layout <- map["layout"] 17 | data <- map["data"] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Tools/msgs/std_msgs/HeaderMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HeaderMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class HeaderMessage: RBSMessage { 11 | public var seq: uint32 = 0 12 | public var stamp: time 13 | public var frame_id: string 14 | 15 | 16 | public override func mapping(map: Map) { 17 | seq <- map["seq"] 18 | stamp <- map["stamp"] 19 | frame_id <- map["frame_id"] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Example/RBSManager/Images.xcassets/turtleIcon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "turtleIcon.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "turtleIcon@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example/RBSManager/Images.xcassets/up_icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icons8-up_circular-1.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "icons8-up_circular.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Geographic/GeoPointMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GeoPointMessage.swift 3 | // RBSManager 4 | // 5 | // Created by Wes Goodhoofd on 2020-08-16. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | public class GeoPointMessage: RBSMessage { 12 | public var latitude: Float64 = 0 13 | public var longitude: Float64 = 0 14 | 15 | public override func mapping(map: Map) { 16 | latitude <- map["latitude"] 17 | longitude <- map["longitude"] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Geometry/PointMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PointMessage.swift 3 | // Pods 4 | // 5 | // Created by Wes Goodhoofd on 2018-01-11. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | public class PointMessage: RBSMessage { 12 | public var x: Float64 = 0 13 | public var y: Float64 = 0 14 | public var z: Float64 = 0 15 | 16 | public override func mapping(map: Map) { 17 | x <- map["x"] 18 | y <- map["y"] 19 | z <- map["z"] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Tools/msgs/std_msgs/MultiArrayLayoutMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MultiArrayLayoutMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class MultiArrayLayoutMessage: RBSMessage { 11 | public var dim: MultiArrayDimension[] = [MultiArrayDimension[]]() 12 | public var data_offset: uint32 = 0 13 | 14 | 15 | public override func mapping(map: Map) { 16 | dim <- map["dim"] 17 | data_offset <- map["data_offset"] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Example/RBSManager/Images.xcassets/down_icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icons8-down_circular-1.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "icons8-down_circular.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example/RBSManager/Images.xcassets/left_icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icons8-left_circular-1.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "icons8-left_circular.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /Example/RBSManager/Images.xcassets/right_icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "icons8-right_circular-1.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "icons8-right_circular.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /JoyMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JoyMessage.swift 3 | // RBSManager 4 | // 5 | // Created by Brandon Man on 22/7/2019. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | public class JoyMessage: RBSMessage { 12 | public var axes: Array = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0] 13 | public var buttons: Array = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] 14 | 15 | 16 | public override func mapping(map: Map) { 17 | axes <- map["axes"] 18 | buttons <- map["buttons"] 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Geometry/Vector3Message.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Vector3Message.swift 3 | // RBSManager 4 | // 5 | // Created by Wes Goodhoofd on 2018-01-10. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | public class Vector3Message: RBSMessage { 12 | public var x: Float64 = 0 13 | public var y: Float64 = 0 14 | public var z: Float64 = 0 15 | 16 | override public func mapping(map: Map) { 17 | x <- map["x"] 18 | y <- map["y"] 19 | z <- map["z"] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Tools/msgs/std_msgs/ColorRGBAMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ColorRGBAMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class ColorRGBAMessage: RBSMessage { 11 | public var r: float32 = 0 12 | public var g: float32 = 0 13 | public var b: float32 = 0 14 | public var a: float32 = 0 15 | 16 | 17 | public override func mapping(map: Map) { 18 | r <- map["r"] 19 | g <- map["g"] 20 | b <- map["b"] 21 | a <- map["a"] 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Tools/msgs/geometry_msgs/QuaternionMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // QuaternionMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class QuaternionMessage: RBSMessage { 11 | public var x: float64 = 0 12 | public var y: float64 = 0 13 | public var z: float64 = 0 14 | public var w: float64 = 0 15 | 16 | 17 | public override func mapping(map: Map) { 18 | x <- map["x"] 19 | y <- map["y"] 20 | z <- map["z"] 21 | w <- map["w"] 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Tools/msgs/std_msgs/MultiArrayDimensionMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MultiArrayDimensionMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class MultiArrayDimensionMessage: RBSMessage { 11 | public var label: string 12 | public var size: uint32 = 0 13 | public var stride: uint32 = 0 14 | 15 | 16 | public override func mapping(map: Map) { 17 | label <- map["label"] 18 | size <- map["size"] 19 | stride <- map["stride"] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/JoyMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JoyMessage.swift 3 | // RBSManager 4 | // 5 | // Created by Brandon Man on 22/7/2019. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | public class JoyMessage: RBSMessage { 12 | public var axes: Array = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0] 13 | public var buttons: Array = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] 14 | 15 | 16 | public override func mapping(map: Map) { 17 | axes <- map["axes"] 18 | buttons <- map["buttons"] 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Standard/MultiArrayDimensionMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MultiArrayDimensionMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2018-09-19. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class MultiArrayDimensionMessage: RBSMessage { 11 | public var label: String? 12 | public var size: UInt32 = 0 13 | public var stride: UInt32 = 0 14 | 15 | public override func mapping(map: Map) { 16 | label <- map["label"] 17 | size <- map["size"] 18 | stride <- map["stride"] 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Turtlesim/TeleportAbsoluteMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TeleportAbsoluteMessage.swift 3 | // Pods 4 | // 5 | // Created by Wes Goodhoofd on 2018-01-17. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | public class TeleportAbsoluteMessage: RBSMessage { 12 | public var x: Float64 = 0 13 | public var y: Float64 = 0 14 | public var theta: Float64 = 0 15 | 16 | override public func mapping(map: Map) { 17 | x <- map["x"] 18 | y <- map["y"] 19 | theta <- map["theta"] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Tools/msgs/geometry_msgs/PolygonMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PolygonMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class PolygonMessage: RBSMessage { 11 | public var points: Point32Message[]? = [Point32Message[]]() 12 | 13 | public override init() { 14 | super.init() 15 | points = Point32Message[]() 16 | } 17 | public required init?(map: Map) { 18 | super.init(map: map) 19 | } 20 | 21 | public override func mapping(map: Map) { 22 | points <- map["points"] 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Geometry/QuaternionMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // QuaternionMessage.swift 3 | // RBSManager 4 | // 5 | // Created by Wes Goodhoofd on 2019-08-07. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | public class QuaternionMessage: RBSMessage { 12 | public var x: Float64 = 0 13 | public var y: Float64 = 0 14 | public var z: Float64 = 0 15 | public var w: Float64 = 0 16 | 17 | public override func mapping(map: Map) { 18 | x <- map["x"] 19 | y <- map["y"] 20 | z <- map["z"] 21 | w <- map["w"] 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Tools/msgs/visualization_msgs/MarkerArrayMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MarkerArrayMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class MarkerArrayMessage: RBSMessage { 11 | public var markers: MarkerMessage[]? = [MarkerMessage[]]() 12 | 13 | public override init() { 14 | super.init() 15 | markers = MarkerMessage[]() 16 | } 17 | public required init?(map: Map) { 18 | super.init(map: map) 19 | } 20 | 21 | public override func mapping(map: Map) { 22 | markers <- map["markers"] 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Tools/msgs/sensor_msgs/JoyFeedbackArrayMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JoyFeedbackArrayMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class JoyFeedbackArrayMessage: RBSMessage { 11 | public var array: JoyFeedbackMessage[]? = [JoyFeedbackMessage[]]() 12 | 13 | public override init() { 14 | super.init() 15 | array = JoyFeedbackMessage[]() 16 | } 17 | public required init?(map: Map) { 18 | super.init(map: map) 19 | } 20 | 21 | public override func mapping(map: Map) { 22 | array <- map["array"] 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Tools/msgs/geometry_msgs/PoseStampedMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PoseStampedMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class PoseStampedMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var pose: PoseMessage? 13 | 14 | public override init() { 15 | super.init() 16 | header = HeaderMessage() 17 | pose = PoseMessage() 18 | } 19 | public required init?(map: Map) { 20 | super.init(map: map) 21 | } 22 | 23 | public override func mapping(map: Map) { 24 | header <- map["header"] 25 | pose <- map["pose"] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Tools/msgs/geometry_msgs/WrenchMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WrenchMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class WrenchMessage: RBSMessage { 11 | public var force: Vector3Message? 12 | public var torque: Vector3Message? 13 | 14 | public override init() { 15 | super.init() 16 | force = Vector3Message() 17 | torque = Vector3Message() 18 | } 19 | public required init?(map: Map) { 20 | super.init(map: map) 21 | } 22 | 23 | public override func mapping(map: Map) { 24 | force <- map["force"] 25 | torque <- map["torque"] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Tools/msgs/geometry_msgs/AccelMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AccelMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class AccelMessage: RBSMessage { 11 | public var linear: Vector3Message? 12 | public var angular: Vector3Message? 13 | 14 | public override init() { 15 | super.init() 16 | linear = Vector3Message() 17 | angular = Vector3Message() 18 | } 19 | public required init?(map: Map) { 20 | super.init(map: map) 21 | } 22 | 23 | public override func mapping(map: Map) { 24 | linear <- map["linear"] 25 | angular <- map["angular"] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Tools/msgs/geometry_msgs/TwistMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TwistMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class TwistMessage: RBSMessage { 11 | public var linear: Vector3Message? 12 | public var angular: Vector3Message? 13 | 14 | public override init() { 15 | super.init() 16 | linear = Vector3Message() 17 | angular = Vector3Message() 18 | } 19 | public required init?(map: Map) { 20 | super.init(map: map) 21 | } 22 | 23 | public override func mapping(map: Map) { 24 | linear <- map["linear"] 25 | angular <- map["angular"] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Tools/msgs/geometry_msgs/AccelStampedMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AccelStampedMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class AccelStampedMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var accel: AccelMessage? 13 | 14 | public override init() { 15 | super.init() 16 | header = HeaderMessage() 17 | accel = AccelMessage() 18 | } 19 | public required init?(map: Map) { 20 | super.init(map: map) 21 | } 22 | 23 | public override func mapping(map: Map) { 24 | header <- map["header"] 25 | accel <- map["accel"] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Tools/msgs/geometry_msgs/TwistStampedMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TwistStampedMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class TwistStampedMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var twist: TwistMessage? 13 | 14 | public override init() { 15 | super.init() 16 | header = HeaderMessage() 17 | twist = TwistMessage() 18 | } 19 | public required init?(map: Map) { 20 | super.init(map: map) 21 | } 22 | 23 | public override func mapping(map: Map) { 24 | header <- map["header"] 25 | twist <- map["twist"] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Tools/msgs/geometry_msgs/PointStampedMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PointStampedMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class PointStampedMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var point: PointMessage? = 0 13 | 14 | public override init() { 15 | super.init() 16 | header = HeaderMessage() 17 | point = PointMessage() 18 | } 19 | public required init?(map: Map) { 20 | super.init(map: map) 21 | } 22 | 23 | public override func mapping(map: Map) { 24 | header <- map["header"] 25 | point <- map["point"] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Tools/msgs/geometry_msgs/PoseWithCovarianceMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PoseWithCovarianceMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class PoseWithCovarianceMessage: RBSMessage { 11 | public var pose: PoseMessage? 12 | public var covariance: float64[36] = [float64[36]]() 13 | 14 | public override init() { 15 | super.init() 16 | pose = PoseMessage() 17 | } 18 | public required init?(map: Map) { 19 | super.init(map: map) 20 | } 21 | 22 | public override func mapping(map: Map) { 23 | pose <- map["pose"] 24 | covariance <- map["covariance"] 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Tools/msgs/geometry_msgs/WrenchStampedMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WrenchStampedMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class WrenchStampedMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var wrench: WrenchMessage? 13 | 14 | public override init() { 15 | super.init() 16 | header = HeaderMessage() 17 | wrench = WrenchMessage() 18 | } 19 | public required init?(map: Map) { 20 | super.init(map: map) 21 | } 22 | 23 | public override func mapping(map: Map) { 24 | header <- map["header"] 25 | wrench <- map["wrench"] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - ObjectMapper (4.2.0) 3 | - RBSManager (0.4): 4 | - ObjectMapper (~> 4.2) 5 | - Starscream (~> 3.1.1) 6 | - Starscream (3.1.1) 7 | 8 | DEPENDENCIES: 9 | - RBSManager (from `../`) 10 | 11 | SPEC REPOS: 12 | trunk: 13 | - ObjectMapper 14 | - Starscream 15 | 16 | EXTERNAL SOURCES: 17 | RBSManager: 18 | :path: "../" 19 | 20 | SPEC CHECKSUMS: 21 | ObjectMapper: 1eb41f610210777375fa806bf161dc39fb832b81 22 | RBSManager: 67cfce80e0103ca4073b23c73aac646158b3331b 23 | Starscream: 4bb2f9942274833f7b4d296a55504dcfc7edb7b0 24 | 25 | PODFILE CHECKSUM: f846aef6eda8851afffa37dff07fc3a0c9176da6 26 | 27 | COCOAPODS: 1.8.4 28 | -------------------------------------------------------------------------------- /Tools/msgs/geometry_msgs/AccelWithCovarianceMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AccelWithCovarianceMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class AccelWithCovarianceMessage: RBSMessage { 11 | public var accel: AccelMessage? 12 | public var covariance: float64[36] = [float64[36]]() 13 | 14 | public override init() { 15 | super.init() 16 | accel = AccelMessage() 17 | } 18 | public required init?(map: Map) { 19 | super.init(map: map) 20 | } 21 | 22 | public override func mapping(map: Map) { 23 | accel <- map["accel"] 24 | covariance <- map["covariance"] 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Tools/msgs/geometry_msgs/PoseArrayMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PoseArrayMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class PoseArrayMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var poses: PoseMessage[]? = [PoseMessage[]]() 13 | 14 | public override init() { 15 | super.init() 16 | header = HeaderMessage() 17 | poses = PoseMessage[]() 18 | } 19 | public required init?(map: Map) { 20 | super.init(map: map) 21 | } 22 | 23 | public override func mapping(map: Map) { 24 | header <- map["header"] 25 | poses <- map["poses"] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Tools/msgs/geometry_msgs/TwistWithCovarianceMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TwistWithCovarianceMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class TwistWithCovarianceMessage: RBSMessage { 11 | public var twist: TwistMessage? 12 | public var covariance: float64[36] = [float64[36]]() 13 | 14 | public override init() { 15 | super.init() 16 | twist = TwistMessage() 17 | } 18 | public required init?(map: Map) { 19 | super.init(map: map) 20 | } 21 | 22 | public override func mapping(map: Map) { 23 | twist <- map["twist"] 24 | covariance <- map["covariance"] 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Tools/msgs/geometry_msgs/Vector3StampedMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Vector3StampedMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class Vector3StampedMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var vector: Vector3Message? 13 | 14 | public override init() { 15 | super.init() 16 | header = HeaderMessage() 17 | vector = Vector3Message() 18 | } 19 | public required init?(map: Map) { 20 | super.init(map: map) 21 | } 22 | 23 | public override func mapping(map: Map) { 24 | header <- map["header"] 25 | vector <- map["vector"] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Tools/msgs/nav_msgs/PathMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PathMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class PathMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var poses: PoseStampedMessage[]? = [PoseStampedMessage[]]() 13 | 14 | public override init() { 15 | super.init() 16 | header = HeaderMessage() 17 | poses = PoseStampedMessage[]() 18 | } 19 | public required init?(map: Map) { 20 | super.init(map: map) 21 | } 22 | 23 | public override func mapping(map: Map) { 24 | header <- map["header"] 25 | poses <- map["poses"] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Tools/msgs/geometry_msgs/InertiaStampedMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // InertiaStampedMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class InertiaStampedMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var inertia: InertiaMessage? 13 | 14 | public override init() { 15 | super.init() 16 | header = HeaderMessage() 17 | inertia = InertiaMessage() 18 | } 19 | public required init?(map: Map) { 20 | super.init(map: map) 21 | } 22 | 23 | public override func mapping(map: Map) { 24 | header <- map["header"] 25 | inertia <- map["inertia"] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Tools/msgs/geometry_msgs/PolygonStampedMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PolygonStampedMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class PolygonStampedMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var polygon: PolygonMessage? 13 | 14 | public override init() { 15 | super.init() 16 | header = HeaderMessage() 17 | polygon = PolygonMessage() 18 | } 19 | public required init?(map: Map) { 20 | super.init(map: map) 21 | } 22 | 23 | public override func mapping(map: Map) { 24 | header <- map["header"] 25 | polygon <- map["polygon"] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Tools/msgs/geometry_msgs/PoseMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PoseMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class PoseMessage: RBSMessage { 11 | public var position: PointMessage? = 0 12 | public var orientation: QuaternionMessage? 13 | 14 | public override init() { 15 | super.init() 16 | position = PointMessage() 17 | orientation = QuaternionMessage() 18 | } 19 | public required init?(map: Map) { 20 | super.init(map: map) 21 | } 22 | 23 | public override func mapping(map: Map) { 24 | position <- map["position"] 25 | orientation <- map["orientation"] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Standard/ByteMultiArrayMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ByteMultiArrayMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2018-09-19. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class ByteMultiArrayMessage: RBSMessage { 11 | public var layout: MultiArrayLayoutMessage? 12 | public var data = [UInt8]() 13 | 14 | public override init() { 15 | super.init() 16 | layout = MultiArrayLayoutMessage() 17 | } 18 | 19 | public required init?(map: Map) { 20 | super.init(map: map) 21 | } 22 | 23 | public override func mapping(map: Map) { 24 | layout <- map["layout"] 25 | data <- map["data"] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Tools/msgs/sensor_msgs/JoyMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JoyMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class JoyMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var axes: float32[] = [float32[]]() 13 | public var buttons: int32[] = [int32[]]() 14 | 15 | public override init() { 16 | super.init() 17 | header = HeaderMessage() 18 | } 19 | public required init?(map: Map) { 20 | super.init(map: map) 21 | } 22 | 23 | public override func mapping(map: Map) { 24 | header <- map["header"] 25 | axes <- map["axes"] 26 | buttons <- map["buttons"] 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Tools/msgs/geometry_msgs/TransformMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TransformMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class TransformMessage: RBSMessage { 11 | public var translation: Vector3Message? 12 | public var rotation: QuaternionMessage? 13 | 14 | public override init() { 15 | super.init() 16 | translation = Vector3Message() 17 | rotation = QuaternionMessage() 18 | } 19 | public required init?(map: Map) { 20 | super.init(map: map) 21 | } 22 | 23 | public override func mapping(map: Map) { 24 | translation <- map["translation"] 25 | rotation <- map["rotation"] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Tools/msgs/geometry_msgs/QuaternionStampedMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // QuaternionStampedMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class QuaternionStampedMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var quaternion: QuaternionMessage? 13 | 14 | public override init() { 15 | super.init() 16 | header = HeaderMessage() 17 | quaternion = QuaternionMessage() 18 | } 19 | public required init?(map: Map) { 20 | super.init(map: map) 21 | } 22 | 23 | public override func mapping(map: Map) { 24 | header <- map["header"] 25 | quaternion <- map["quaternion"] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Standard/MultiArrayLayoutMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MultiArrayLayoutMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2018-09-19. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class MultiArrayLayoutMessage: RBSMessage { 11 | public var dim: [MultiArrayDimensionMessage]? 12 | public var data_offset: UInt32 = 0 13 | 14 | public override init() { 15 | super.init() 16 | dim = [MultiArrayDimensionMessage]() 17 | } 18 | 19 | public required init?(map: Map) { 20 | super.init(map: map) 21 | } 22 | 23 | public override func mapping(map: Map) { 24 | dim <- map["dim"] 25 | data_offset <- map["data_offset"] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Tools/msgs/geometry_msgs/PoseWithCovarianceStampedMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PoseWithCovarianceStampedMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class PoseWithCovarianceStampedMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var pose: PoseWithCovarianceMessage? 13 | 14 | public override init() { 15 | super.init() 16 | header = HeaderMessage() 17 | pose = PoseWithCovarianceMessage() 18 | } 19 | public required init?(map: Map) { 20 | super.init(map: map) 21 | } 22 | 23 | public override func mapping(map: Map) { 24 | header <- map["header"] 25 | pose <- map["pose"] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Tools/msgs/shape_msgs/MeshMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MeshMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class MeshMessage: RBSMessage { 11 | public var triangles: MeshTriangleMessage[]? = [MeshTriangleMessage[]]() 12 | public var vertices: PointMessage[]? = [PointMessage[]]() 13 | 14 | public override init() { 15 | super.init() 16 | triangles = MeshTriangleMessage[]() 17 | vertices = PointMessage[]() 18 | } 19 | public required init?(map: Map) { 20 | super.init(map: map) 21 | } 22 | 23 | public override func mapping(map: Map) { 24 | triangles <- map["triangles"] 25 | vertices <- map["vertices"] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Tools/msgs/geometry_msgs/AccelWithCovarianceStampedMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AccelWithCovarianceStampedMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class AccelWithCovarianceStampedMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var accel: AccelWithCovarianceMessage? 13 | 14 | public override init() { 15 | super.init() 16 | header = HeaderMessage() 17 | accel = AccelWithCovarianceMessage() 18 | } 19 | public required init?(map: Map) { 20 | super.init(map: map) 21 | } 22 | 23 | public override func mapping(map: Map) { 24 | header <- map["header"] 25 | accel <- map["accel"] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Tools/msgs/geometry_msgs/TwistWithCovarianceStampedMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TwistWithCovarianceStampedMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class TwistWithCovarianceStampedMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var twist: TwistWithCovarianceMessage? 13 | 14 | public override init() { 15 | super.init() 16 | header = HeaderMessage() 17 | twist = TwistWithCovarianceMessage() 18 | } 19 | public required init?(map: Map) { 20 | super.init(map: map) 21 | } 22 | 23 | public override func mapping(map: Map) { 24 | header <- map["header"] 25 | twist <- map["twist"] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Sensor/TemperatureMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TemperatureMessage.swift 3 | // RBSManager 4 | // 5 | // Created by Wes Goodhoofd on 2019-08-03. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | public class TemperatureMessage: RBSMessage { 12 | public var temperature: Float64 = 0 13 | public var header: HeaderMessage? 14 | 15 | public override init() { 16 | super.init() 17 | header = HeaderMessage() 18 | } 19 | 20 | public required init?(map: Map) { 21 | super.init(map: map) 22 | } 23 | 24 | override public func mapping(map: Map) { 25 | header <- map["header"] 26 | temperature <- map["temperature"] 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Tools/msgs/actionlib_msgs/GoalStatusArrayMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GoalStatusArrayMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class GoalStatusArrayMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var status_list: GoalStatusMessage[]? = [GoalStatusMessage[]]() 13 | 14 | public override init() { 15 | super.init() 16 | header = HeaderMessage() 17 | status_list = GoalStatusMessage[]() 18 | } 19 | public required init?(map: Map) { 20 | super.init(map: map) 21 | } 22 | 23 | public override func mapping(map: Map) { 24 | header <- map["header"] 25 | status_list <- map["status_list"] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Tools/msgs/diagnostic_msgs/DiagnosticArrayMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DiagnosticArrayMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class DiagnosticArrayMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var status: DiagnosticStatusMessage[]? = [DiagnosticStatusMessage[]]() 13 | 14 | public override init() { 15 | super.init() 16 | header = HeaderMessage() 17 | status = DiagnosticStatusMessage[]() 18 | } 19 | public required init?(map: Map) { 20 | super.init(map: map) 21 | } 22 | 23 | public override func mapping(map: Map) { 24 | header <- map["header"] 25 | status <- map["status"] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Tools/msgs/nav_msgs/OccupancyGridMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OccupancyGridMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class OccupancyGridMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var info: MapMetaDataMessage? 13 | public var data: int8[] = [int8[]]() 14 | 15 | public override init() { 16 | super.init() 17 | header = HeaderMessage() 18 | info = MapMetaDataMessage() 19 | } 20 | public required init?(map: Map) { 21 | super.init(map: map) 22 | } 23 | 24 | public override func mapping(map: Map) { 25 | header <- map["header"] 26 | info <- map["info"] 27 | data <- map["data"] 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Geometry/WrenchMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WrenchMessage.swift 3 | // Pods 4 | // 5 | // Created by Wes Goodhoofd on 2018-01-11. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | public class WrenchMessage: RBSMessage { 12 | public var force: Vector3Message? 13 | public var torque: Vector3Message? 14 | 15 | public override init() { 16 | super.init() 17 | force = Vector3Message() 18 | torque = Vector3Message() 19 | } 20 | 21 | public required init?(map: Map) { 22 | super.init(map: map) 23 | } 24 | 25 | override public func mapping(map: Map) { 26 | force <- map["force"] 27 | torque <- map["torque"] 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Tools/msgs/sensor_msgs/JoyFeedbackMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JoyFeedbackMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class JoyFeedbackMessage: RBSMessage { 11 | public var TYPE_LED: uint8 = 0 12 | public var TYPE_RUMBLE: uint8 = 0 13 | public var TYPE_BUZZER: uint8 = 0 14 | public var type: uint8 = 0 15 | public var id: uint8 = 0 16 | public var intensity: float32 = 0 17 | 18 | 19 | public override func mapping(map: Map) { 20 | TYPE_LED <- map["TYPE_LED"] 21 | TYPE_RUMBLE <- map["TYPE_RUMBLE"] 22 | TYPE_BUZZER <- map["TYPE_BUZZER"] 23 | type <- map["type"] 24 | id <- map["id"] 25 | intensity <- map["intensity"] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Tools/msgs/visualization_msgs/InteractiveMarkerPoseMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // InteractiveMarkerPoseMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class InteractiveMarkerPoseMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var pose: PoseMessage? 13 | public var name: string 14 | 15 | public override init() { 16 | super.init() 17 | header = HeaderMessage() 18 | pose = PoseMessage() 19 | } 20 | public required init?(map: Map) { 21 | super.init(map: map) 22 | } 23 | 24 | public override func mapping(map: Map) { 25 | header <- map["header"] 26 | pose <- map["pose"] 27 | name <- map["name"] 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Geometry/PoseStampedMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PoseStampedMessage.swift 3 | // RBSManager 4 | // 5 | // Created by Wes Goodhoofd on 2019-08-07. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | public class PoseStampedMessage: RBSMessage { 12 | public var header: HeaderMessage? 13 | public var pose: PoseMessage? 14 | 15 | public override init() { 16 | super.init() 17 | header = HeaderMessage() 18 | pose = PoseMessage() 19 | } 20 | 21 | public required init?(map: Map) { 22 | super.init(map: map) 23 | } 24 | 25 | override public func mapping(map: Map) { 26 | header <- map["header"] 27 | pose <- map["pose"] 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Geometry/TwistStampedMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TwistStampedMessage.swift 3 | // Pods 4 | // 5 | // Created by Jason Pack on 2018-11-13. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | public class TwistStampedMessage: RBSMessage { 12 | public var header: HeaderMessage? 13 | public var twist: TwistMessage? 14 | 15 | public override init() { 16 | super.init() 17 | header = HeaderMessage() 18 | twist = TwistMessage() 19 | } 20 | 21 | public required init?(map: Map) { 22 | super.init(map: map) 23 | } 24 | 25 | override public func mapping(map: Map) { 26 | header <- map["header"] 27 | twist <- map["twist"] 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Geometry/TwistMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TwistMessage.swift 3 | // ObjectMapper 4 | // 5 | // Created by Wes Goodhoofd on 2018-01-10. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | public class TwistMessage: RBSMessage { 12 | public var linear: Vector3Message? 13 | public var angular: Vector3Message? 14 | 15 | public override init() { 16 | super.init() 17 | linear = Vector3Message() 18 | angular = Vector3Message() 19 | } 20 | 21 | public required init?(map: Map) { 22 | super.init(map: map) 23 | } 24 | 25 | override public func mapping(map: Map) { 26 | linear <- map["linear"] 27 | angular <- map["angular"] 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Standard/TImeMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TImeMessage.swift 3 | // Pods 4 | // 5 | // Created by Wes Goodhoofd on 2018-01-11. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | public class TimeMessage: RBSMessage { 12 | public var sec: Float64 = 0 13 | public var nsec: Float64 = 0 14 | 15 | public override init() { 16 | super.init() 17 | } 18 | 19 | public required init?(map: Map) { 20 | super.init(map: map) 21 | } 22 | 23 | override public func mapping(map: Map) { 24 | sec <- map["secs"] 25 | nsec <- map["nsecs"] 26 | } 27 | 28 | public func date() -> Date { 29 | return Date(timeIntervalSinceReferenceDate: sec) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Navigation/PathMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PathMessage.swift 3 | // RBSManager 4 | // 5 | // Created by Wes Goodhoofd on 2019-08-07. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | public class PathMessage: RBSMessage { 12 | public var header: HeaderMessage? 13 | public var poses: [GeoPoseStampedMessage]? 14 | 15 | public override init() { 16 | super.init() 17 | header = HeaderMessage() 18 | poses = [GeoPoseStampedMessage]() 19 | } 20 | 21 | public required init?(map: Map) { 22 | super.init(map: map) 23 | } 24 | 25 | override public func mapping(map: Map) { 26 | header <- map["header"] 27 | poses <- map["poses"] 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Standard/HeaderMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HeaderMessage.swift 3 | // Pods 4 | // 5 | // Created by Wes Goodhoofd on 2018-01-11. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | public class HeaderMessage: RBSMessage { 12 | public var seq: UInt32 = 0 13 | public var stamp: TimeMessage? 14 | public var frameId: String? 15 | 16 | public override init() { 17 | super.init() 18 | stamp = TimeMessage() 19 | } 20 | 21 | public required init?(map: Map) { 22 | super.init(map: map) 23 | } 24 | 25 | override public func mapping(map: Map) { 26 | seq <- map["seq"] 27 | stamp <- map["stamp"] 28 | frameId <- map["frame_id"] 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Standard/Int8MultiArrayMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Int8MultiArrayMessage.swift 3 | // RBSManager 4 | // 5 | // Created by Wes Goodhoofd on 2019-07-26. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | public class Int8MultiArrayMessage: RBSMessage { 12 | public var data: [UInt8]? 13 | public var layout: MultiArrayLayoutMessage? 14 | 15 | public override init() { 16 | super.init() 17 | layout = MultiArrayLayoutMessage() 18 | } 19 | 20 | public required init?(map: Map) { 21 | super.init(map: map) 22 | } 23 | 24 | override public func mapping(map: Map) { 25 | data <- (map["data"], base64Transform) 26 | layout <- map["layout"] 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Tools/msgs/sensor_msgs/TimeReferenceMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TimeReferenceMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class TimeReferenceMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var frame_id: # 13 | public var time_ref: time 14 | public var source: string 15 | 16 | public override init() { 17 | super.init() 18 | header = HeaderMessage() 19 | } 20 | public required init?(map: Map) { 21 | super.init(map: map) 22 | } 23 | 24 | public override func mapping(map: Map) { 25 | header <- map["header"] 26 | frame_id <- map["frame_id"] 27 | time_ref <- map["time_ref"] 28 | source <- map["source"] 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Geographic/GeoPoseStampedMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GeoPoseStampedMessage.swift 3 | // RBSManager 4 | // 5 | // Created by Wes Goodhoofd on 2020-08-16. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | public class GeoPoseStampedMessage: RBSMessage { 12 | public var header: HeaderMessage? 13 | public var pose: GeoPoseMessage? 14 | 15 | public override init() { 16 | super.init() 17 | header = HeaderMessage() 18 | pose = GeoPoseMessage() 19 | } 20 | 21 | public required init?(map: Map) { 22 | super.init(map: map) 23 | } 24 | 25 | public override func mapping(map: Map) { 26 | header <- map["header"] 27 | pose <- map["pose"] 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | 2 | // swift-tools-version:5.1 3 | import PackageDescription 4 | 5 | let package = Package( 6 | name: "RBSManager", 7 | platforms: [ 8 | .iOS(.v10), 9 | ], 10 | products: [ 11 | .library( 12 | name: "RBSManager", 13 | targets: ["RBSManager"]) 14 | ], 15 | dependencies: [ 16 | .package(url: "https://github.com/daltoniam/Starscream.git", from: "3.1.1"), 17 | .package(url: "https://github.com/tristanhimmelman/ObjectMapper.git", from: "4.2.0") 18 | ], 19 | targets: [ 20 | .target( 21 | name: "RBSManager", 22 | dependencies: ["Starscream", "ObjectMapper"], 23 | path: "RBSManager", 24 | sources: ["Classes"]) 25 | ] 26 | ) 27 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Geometry/PoseMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PoseMessage.swift 3 | // RBSManager 4 | // 5 | // Created by Wes Goodhoofd on 2019-08-07. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | public class PoseMessage: RBSMessage { 12 | public var position: PointMessage? 13 | public var orientation: QuaternionMessage? 14 | 15 | public override init() { 16 | super.init() 17 | position = PointMessage() 18 | orientation = QuaternionMessage() 19 | } 20 | 21 | public required init?(map: Map) { 22 | super.init(map: map) 23 | } 24 | 25 | override public func mapping(map: Map) { 26 | position <- map["position"] 27 | orientation <- map["orientation"] 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Geometry/Vector3StampedMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Vector3StampedMessage.swift 3 | // RBSManager 4 | // 5 | // Created by Wes Goodhoofd on 2019-07-20. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | public class Vector3StampedMessage: RBSMessage { 12 | public var header: HeaderMessage? 13 | public var vector: Vector3Message? 14 | 15 | public override init() { 16 | super.init() 17 | header = HeaderMessage() 18 | vector = Vector3Message() 19 | } 20 | 21 | public required init?(map: Map) { 22 | super.init(map: map) 23 | } 24 | 25 | override public func mapping(map: Map) { 26 | header <- map["header"] 27 | vector <- map["vector"] 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Ackermann/AckermannDriveStamped.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AckermannDriveStamped.swift 3 | // RBSManager 4 | // 5 | // Created by Brandon Man on 18/7/2019. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | 12 | public class AckermannDriveStampedMessage: RBSMessage { 13 | public var header: HeaderMessage? 14 | public var drive: AckermannDriveMessage? 15 | 16 | public override init() { 17 | super.init() 18 | header = HeaderMessage() 19 | drive = AckermannDriveMessage() 20 | 21 | } 22 | 23 | public required init?(map: Map) { 24 | super.init(map: map) 25 | } 26 | 27 | override public func mapping(map: Map) { 28 | header <- map["header"] 29 | drive <- map["drive"] 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Tools/msgs/geometry_msgs/TransformStampedMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TransformStampedMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class TransformStampedMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var child_frame_id: string 13 | public var transform: TransformMessage? 14 | 15 | public override init() { 16 | super.init() 17 | header = HeaderMessage() 18 | transform = TransformMessage() 19 | } 20 | public required init?(map: Map) { 21 | super.init(map: map) 22 | } 23 | 24 | public override func mapping(map: Map) { 25 | header <- map["header"] 26 | child_frame_id <- map["child_frame_id"] 27 | transform <- map["transform"] 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Tools/msgs/sensor_msgs/RegionOfInterestMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RegionOfInterestMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class RegionOfInterestMessage: RBSMessage { 11 | public var x_offset: uint32 = 0 12 | public var (0: # 13 | public var y_offset: uint32 = 0 14 | public var (0: # 15 | public var height: uint32 = 0 16 | public var width: uint32 = 0 17 | public var do_rectify: bool = false 18 | 19 | 20 | public override func mapping(map: Map) { 21 | x_offset <- map["x_offset"] 22 | (0 <- map["(0"] 23 | y_offset <- map["y_offset"] 24 | (0 <- map["(0"] 25 | height <- map["height"] 26 | width <- map["width"] 27 | do_rectify <- map["do_rectify"] 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Geographic/GeoPoseMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GeoPoseMessage.swift 3 | // RBSManager 4 | // 5 | // Created by Wes Goodhoofd on 2020-08-16. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | public class GeoPoseMessage: RBSMessage { 12 | public var position: GeoPointMessage? 13 | public var orientation: QuaternionMessage? 14 | 15 | public override init() { 16 | super.init() 17 | position = GeoPointMessage() 18 | orientation = QuaternionMessage() 19 | } 20 | 21 | public required init?(map: Map) { 22 | super.init(map: map) 23 | } 24 | 25 | public override func mapping(map: Map) { 26 | position <- map["position"] 27 | orientation <- map["orientation"] 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /RBSManager/Classes/RBSMessageContainer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RBSMessageContainer.swift 3 | // Pods 4 | // 5 | // Created by Wes Goodhoofd on 2018-01-06. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | public class RBSMessageContainer: NSObject, Mappable { 12 | var op = "publish" 13 | var msg: RBSMessage? 14 | var topic: String? 15 | var publisherId: String? 16 | 17 | required public init?(map: Map) { 18 | 19 | } 20 | 21 | init(_ msg: RBSMessage, topic t: String) { 22 | self.msg = msg 23 | self.topic = t 24 | } 25 | 26 | public func mapping(map: Map) { 27 | self.op <- map["op"] 28 | self.msg <- map["msg"] 29 | self.topic <- map["topic"] 30 | self.publisherId <- map["id"] 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Tools/msgs/visualization_msgs/InteractiveMarkerInitMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // InteractiveMarkerInitMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class InteractiveMarkerInitMessage: RBSMessage { 11 | public var server_id: string 12 | public var seq_num: uint64 = 0 13 | public var markers: InteractiveMarkerMessage[]? = [InteractiveMarkerMessage[]]() 14 | 15 | public override init() { 16 | super.init() 17 | markers = InteractiveMarkerMessage[]() 18 | } 19 | public required init?(map: Map) { 20 | super.init(map: map) 21 | } 22 | 23 | public override func mapping(map: Map) { 24 | server_id <- map["server_id"] 25 | seq_num <- map["seq_num"] 26 | markers <- map["markers"] 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Ackermann/AckermannDriveStamped.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AckermannDriveStamped.swift 3 | // RBSManager 4 | // 5 | // Created by Brandon Man on 18/7/2019. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | 12 | public class AckermannDriveStampedMessage: RBSMessage { 13 | public var header: HeaderMessage? 14 | public var drive: AckermannDriveMessage? 15 | 16 | public override init() { 17 | super.init() 18 | header = HeaderMessage() 19 | drive = AckermannDriveMessage() 20 | 21 | } 22 | 23 | public required init?(map: Map) { 24 | super.init(map: map) 25 | } 26 | 27 | override public func mapping(map: Map) { 28 | header <- map["header"] 29 | drive <- map["drive"] 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Tools/msgs/trajectory_msgs/JointTrajectoryPointMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JointTrajectoryPointMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class JointTrajectoryPointMessage: RBSMessage { 11 | public var positions: float64[] = [float64[]]() 12 | public var velocities: float64[] = [float64[]]() 13 | public var accelerations: float64[] = [float64[]]() 14 | public var effort: float64[] = [float64[]]() 15 | public var time_from_start: duration 16 | 17 | 18 | public override func mapping(map: Map) { 19 | positions <- map["positions"] 20 | velocities <- map["velocities"] 21 | accelerations <- map["accelerations"] 22 | effort <- map["effort"] 23 | time_from_start <- map["time_from_start"] 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Ackermann/AckermannDriveMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AckermannDriveMessage.swift 3 | // RBSManager 4 | // 5 | // Created by Brandon Man on 25/7/2019. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | public class AckermannDriveMessage: RBSMessage{ 12 | public var steering_angle: Float32? 13 | public var steering_angle_velocity: Float32? 14 | public var speed: Float32? 15 | public var acceleration: Float32? 16 | public var jerk: Float32? 17 | 18 | 19 | 20 | 21 | 22 | public override func mapping(map: Map) { 23 | steering_angle <- map["steering_angle"] 24 | steering_angle_velocity <- map["steering_angle_velocity"] 25 | speed <- map["speed"] 26 | acceleration <- map["acceleration"] 27 | jerk <- map["jerk"] 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /Tools/msgs/nav_msgs/GridCellsMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GridCellsMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class GridCellsMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var cell_width: float32 = 0 13 | public var cell_height: float32 = 0 14 | public var cells: PointMessage[]? = [PointMessage[]]() 15 | 16 | public override init() { 17 | super.init() 18 | header = HeaderMessage() 19 | cells = PointMessage[]() 20 | } 21 | public required init?(map: Map) { 22 | super.init(map: map) 23 | } 24 | 25 | public override func mapping(map: Map) { 26 | header <- map["header"] 27 | cell_width <- map["cell_width"] 28 | cell_height <- map["cell_height"] 29 | cells <- map["cells"] 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Tools/msgs/sensor_msgs/TemperatureMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TemperatureMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class TemperatureMessage: RBSMessage { 11 | public var Single: # 12 | public var header: HeaderMessage? 13 | public var frame_id: # 14 | public var temperature: float64 = 0 15 | public var variance: float64 = 0 16 | 17 | public override init() { 18 | super.init() 19 | header = HeaderMessage() 20 | } 21 | public required init?(map: Map) { 22 | super.init(map: map) 23 | } 24 | 25 | public override func mapping(map: Map) { 26 | Single <- map["Single"] 27 | header <- map["header"] 28 | frame_id <- map["frame_id"] 29 | temperature <- map["temperature"] 30 | variance <- map["variance"] 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Tools/msgs/trajectory_msgs/JointTrajectoryMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JointTrajectoryMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class JointTrajectoryMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var joint_names: string[] = [string[]]() 13 | public var points: JointTrajectoryPointMessage[]? = [JointTrajectoryPointMessage[]]() 14 | 15 | public override init() { 16 | super.init() 17 | header = HeaderMessage() 18 | points = JointTrajectoryPointMessage[]() 19 | } 20 | public required init?(map: Map) { 21 | super.init(map: map) 22 | } 23 | 24 | public override func mapping(map: Map) { 25 | header <- map["header"] 26 | joint_names <- map["joint_names"] 27 | points <- map["points"] 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Tools/msgs/nav_msgs/MapMetaDataMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MapMetaDataMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class MapMetaDataMessage: RBSMessage { 11 | public var map_load_time: time 12 | public var resolution: float32 = 0 13 | public var width: uint32 = 0 14 | public var height: uint32 = 0 15 | public var origin: PoseMessage? 16 | 17 | public override init() { 18 | super.init() 19 | origin = PoseMessage() 20 | } 21 | public required init?(map: Map) { 22 | super.init(map: map) 23 | } 24 | 25 | public override func mapping(map: Map) { 26 | map_load_time <- map["map_load_time"] 27 | resolution <- map["resolution"] 28 | width <- map["width"] 29 | height <- map["height"] 30 | origin <- map["origin"] 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Tools/msgs/sensor_msgs/PointCloudMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PointCloudMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class PointCloudMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var points: Point32Message[]? = [Point32Message[]]() 13 | public var channels: ChannelFloat32Message[]? = [ChannelFloat32Message[]]() 14 | 15 | public override init() { 16 | super.init() 17 | header = HeaderMessage() 18 | points = Point32Message[]() 19 | channels = ChannelFloat32Message[]() 20 | } 21 | public required init?(map: Map) { 22 | super.init(map: map) 23 | } 24 | 25 | public override func mapping(map: Map) { 26 | header <- map["header"] 27 | points <- map["points"] 28 | channels <- map["channels"] 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Example/Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Ackermann/AckermannDriveMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AckermannDriveMessage.swift 3 | // RBSManager 4 | // 5 | // Created by Brandon Man on 25/7/2019. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | public class AckermannDriveMessage: RBSMessage{ 12 | public var steering_angle: Float32? 13 | public var steering_angle_velocity: Float32? 14 | public var speed: Float32? 15 | public var acceleration: Float32? 16 | public var jerk: Float32? 17 | 18 | 19 | 20 | 21 | 22 | public override func mapping(map: Map) { 23 | steering_angle <- map["steering_angle"] 24 | steering_angle_velocity <- map["steering_angle_velocity"] 25 | speed <- map["speed"] 26 | acceleration <- map["acceleration"] 27 | jerk <- map["jerk"] 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Sensor/NavSatStatusMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NavSatStatusMessage.swift 3 | // ObjectMapper 4 | // 5 | // Created by Wes Goodhoofd on 2019-07-13. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | public enum NavSatStatus: Int8 { 12 | case STATUS_NO_FIX = -1 13 | case STATUS_FIX 14 | case STATUS_SBAS_FIX 15 | case STATUS_GBAS_FIX 16 | } 17 | 18 | public enum NavSatService: UInt16 { 19 | case SERVICE_GPS = 1 20 | case SERVICE_GLONASS = 2 21 | case SERVICE_COMPASS = 4 22 | case SERVICE_GALILEO = 8 23 | } 24 | 25 | public class NavSatStatusMessage: RBSMessage { 26 | public var service: NavSatService! 27 | public var status: NavSatStatus! 28 | 29 | override public func mapping(map: Map) { 30 | service <- map["service"] 31 | status <- map["status"] 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Tools/msgs/nav_msgs/OdometryMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OdometryMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class OdometryMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var child_frame_id: string 13 | public var pose: PoseWithCovarianceMessage? 14 | public var twist: TwistWithCovarianceMessage? 15 | 16 | public override init() { 17 | super.init() 18 | header = HeaderMessage() 19 | pose = PoseWithCovarianceMessage() 20 | twist = TwistWithCovarianceMessage() 21 | } 22 | public required init?(map: Map) { 23 | super.init(map: map) 24 | } 25 | 26 | public override func mapping(map: Map) { 27 | header <- map["header"] 28 | child_frame_id <- map["child_frame_id"] 29 | pose <- map["pose"] 30 | twist <- map["twist"] 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Tools/msgs/sensor_msgs/JointStateMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JointStateMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class JointStateMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var name: string[] = [string[]]() 13 | public var position: float64[] = [float64[]]() 14 | public var velocity: float64[] = [float64[]]() 15 | public var effort: float64[] = [float64[]]() 16 | 17 | public override init() { 18 | super.init() 19 | header = HeaderMessage() 20 | } 21 | public required init?(map: Map) { 22 | super.init(map: map) 23 | } 24 | 25 | public override func mapping(map: Map) { 26 | header <- map["header"] 27 | name <- map["name"] 28 | position <- map["position"] 29 | velocity <- map["velocity"] 30 | effort <- map["effort"] 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Tools/msgs/trajectory_msgs/MultiDOFJointTrajectoryMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MultiDOFJointTrajectoryMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class MultiDOFJointTrajectoryMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var joint_names: string[] = [string[]]() 13 | public var points: MultiDOFJointTrajectoryPointMessage[]? = [MultiDOFJointTrajectoryPointMessage[]]() 14 | 15 | public override init() { 16 | super.init() 17 | header = HeaderMessage() 18 | points = MultiDOFJointTrajectoryPointMessage[]() 19 | } 20 | public required init?(map: Map) { 21 | super.init(map: map) 22 | } 23 | 24 | public override func mapping(map: Map) { 25 | header <- map["header"] 26 | joint_names <- map["joint_names"] 27 | points <- map["points"] 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Tools/msgs/visualization_msgs/MenuEntryMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MenuEntryMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class MenuEntryMessage: RBSMessage { 11 | public var id: uint32 = 0 12 | public var parent_id: uint32 = 0 13 | public var title: string 14 | public var command: string 15 | public var FEEDBACK=0: uint8 = 0 16 | public var ROSRUN=1: uint8 = 0 17 | public var ROSLAUNCH=2: uint8 = 0 18 | public var command_type: uint8 = 0 19 | 20 | 21 | public override func mapping(map: Map) { 22 | id <- map["id"] 23 | parent_id <- map["parent_id"] 24 | title <- map["title"] 25 | command <- map["command"] 26 | FEEDBACK=0 <- map["FEEDBACK=0"] 27 | ROSRUN=1 <- map["ROSRUN=1"] 28 | ROSLAUNCH=2 <- map["ROSLAUNCH=2"] 29 | command_type <- map["command_type"] 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Example/Tests/Tests.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import XCTest 3 | import RBSManager 4 | 5 | class Tests: XCTestCase { 6 | 7 | override func setUp() { 8 | super.setUp() 9 | // Put setup code here. This method is called before the invocation of each test method in the class. 10 | } 11 | 12 | override func tearDown() { 13 | // Put teardown code here. This method is called after the invocation of each test method in the class. 14 | super.tearDown() 15 | } 16 | 17 | func testExample() { 18 | // This is an example of a functional test case. 19 | XCTAssert(true, "Pass") 20 | } 21 | 22 | func testPerformanceExample() { 23 | // This is an example of a performance test case. 24 | self.measure() { 25 | // Put the code you want to measure the time of here. 26 | } 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /Tools/msgs/geometry_msgs/InertiaMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // InertiaMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class InertiaMessage: RBSMessage { 11 | public var m: float64 = 0 12 | public var com: Vector3Message? 13 | public var ixx: float64 = 0 14 | public var ixy: float64 = 0 15 | public var ixz: float64 = 0 16 | public var iyy: float64 = 0 17 | public var iyz: float64 = 0 18 | public var izz: float64 = 0 19 | 20 | public override init() { 21 | super.init() 22 | com = Vector3Message() 23 | } 24 | public required init?(map: Map) { 25 | super.init(map: map) 26 | } 27 | 28 | public override func mapping(map: Map) { 29 | m <- map["m"] 30 | com <- map["com"] 31 | ixx <- map["ixx"] 32 | ixy <- map["ixy"] 33 | ixz <- map["ixz"] 34 | iyy <- map["iyy"] 35 | iyz <- map["iyz"] 36 | izz <- map["izz"] 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Tools/msgs/sensor_msgs/FluidPressureMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FluidPressureMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class FluidPressureMessage: RBSMessage { 11 | public var Single: # 12 | public var pressure: # 13 | public var atmospheric: # 14 | public var This: # 15 | public var header: HeaderMessage? 16 | public var frame_id: # 17 | public var fluid_pressure: float64 = 0 18 | public var variance: float64 = 0 19 | 20 | public override init() { 21 | super.init() 22 | header = HeaderMessage() 23 | } 24 | public required init?(map: Map) { 25 | super.init(map: map) 26 | } 27 | 28 | public override func mapping(map: Map) { 29 | Single <- map["Single"] 30 | pressure <- map["pressure"] 31 | atmospheric <- map["atmospheric"] 32 | This <- map["This"] 33 | header <- map["header"] 34 | frame_id <- map["frame_id"] 35 | fluid_pressure <- map["fluid_pressure"] 36 | variance <- map["variance"] 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Tools/msgs/trajectory_msgs/MultiDOFJointTrajectoryPointMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MultiDOFJointTrajectoryPointMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class MultiDOFJointTrajectoryPointMessage: RBSMessage { 11 | public var transforms: TransformMessage[]? = [TransformMessage[]]() 12 | public var velocities: TwistMessage[]? = [TwistMessage[]]() 13 | public var accelerations: TwistMessage[]? = [TwistMessage[]]() 14 | public var time_from_start: duration 15 | 16 | public override init() { 17 | super.init() 18 | transforms = TransformMessage[]() 19 | velocities = TwistMessage[]() 20 | accelerations = TwistMessage[]() 21 | } 22 | public required init?(map: Map) { 23 | super.init(map: map) 24 | } 25 | 26 | public override func mapping(map: Map) { 27 | transforms <- map["transforms"] 28 | velocities <- map["velocities"] 29 | accelerations <- map["accelerations"] 30 | time_from_start <- map["time_from_start"] 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Tools/msgs/sensor_msgs/MultiDOFJointStateMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MultiDOFJointStateMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class MultiDOFJointStateMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var joint_names: string[] = [string[]]() 13 | public var transforms: TransformMessage[]? = [TransformMessage[]]() 14 | public var twist: TwistMessage[]? = [TwistMessage[]]() 15 | public var wrench: WrenchMessage[]? = [WrenchMessage[]]() 16 | 17 | public override init() { 18 | super.init() 19 | header = HeaderMessage() 20 | transforms = TransformMessage[]() 21 | twist = TwistMessage[]() 22 | wrench = WrenchMessage[]() 23 | } 24 | public required init?(map: Map) { 25 | super.init(map: map) 26 | } 27 | 28 | public override func mapping(map: Map) { 29 | header <- map["header"] 30 | joint_names <- map["joint_names"] 31 | transforms <- map["transforms"] 32 | twist <- map["twist"] 33 | wrench <- map["wrench"] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Tools/msgs/sensor_msgs/CompressedImageMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CompressedImageMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class CompressedImageMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var Header: # 13 | public var origin: # 14 | public var +x: # 15 | public var +y: # 16 | public var +z: # 17 | public var format: string 18 | public var Acceptable: # 19 | public var jpeg,: # 20 | public var data: uint8[] = [uint8[]]() 21 | 22 | public override init() { 23 | super.init() 24 | header = HeaderMessage() 25 | } 26 | public required init?(map: Map) { 27 | super.init(map: map) 28 | } 29 | 30 | public override func mapping(map: Map) { 31 | header <- map["header"] 32 | Header <- map["Header"] 33 | origin <- map["origin"] 34 | +x <- map["+x"] 35 | +y <- map["+y"] 36 | +z <- map["+z"] 37 | format <- map["format"] 38 | Acceptable <- map["Acceptable"] 39 | jpeg, <- map["jpeg,"] 40 | data <- map["data"] 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Tools/msgs/sensor_msgs/RelativeHumidityMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RelativeHumidityMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class RelativeHumidityMessage: RBSMessage { 11 | public var Single: # 12 | public var pressure: # 13 | public var header: HeaderMessage? 14 | public var frame_id: # 15 | public var relative_humidity: float64 = 0 16 | public var from: # 17 | public var 0.0: # 18 | public var 1.0: # 19 | public var variance: float64 = 0 20 | 21 | public override init() { 22 | super.init() 23 | header = HeaderMessage() 24 | } 25 | public required init?(map: Map) { 26 | super.init(map: map) 27 | } 28 | 29 | public override func mapping(map: Map) { 30 | Single <- map["Single"] 31 | pressure <- map["pressure"] 32 | header <- map["header"] 33 | frame_id <- map["frame_id"] 34 | relative_humidity <- map["relative_humidity"] 35 | from <- map["from"] 36 | 0.0 <- map["0.0"] 37 | 1.0 <- map["1.0"] 38 | variance <- map["variance"] 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Tools/msgs/sensor_msgs/PointFieldMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PointFieldMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class PointFieldMessage: RBSMessage { 11 | public var INT8: uint8 = 0 12 | public var UINT8: uint8 = 0 13 | public var INT16: uint8 = 0 14 | public var UINT16: uint8 = 0 15 | public var INT32: uint8 = 0 16 | public var UINT32: uint8 = 0 17 | public var FLOAT32: uint8 = 0 18 | public var FLOAT64: uint8 = 0 19 | public var name: string 20 | public var offset: uint32 = 0 21 | public var datatype: uint8 = 0 22 | public var count: uint32 = 0 23 | 24 | 25 | public override func mapping(map: Map) { 26 | INT8 <- map["INT8"] 27 | UINT8 <- map["UINT8"] 28 | INT16 <- map["INT16"] 29 | UINT16 <- map["UINT16"] 30 | INT32 <- map["INT32"] 31 | UINT32 <- map["UINT32"] 32 | FLOAT32 <- map["FLOAT32"] 33 | FLOAT64 <- map["FLOAT64"] 34 | name <- map["name"] 35 | offset <- map["offset"] 36 | datatype <- map["datatype"] 37 | count <- map["count"] 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Tools/msgs/diagnostic_msgs/DiagnosticStatusMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DiagnosticStatusMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class DiagnosticStatusMessage: RBSMessage { 11 | public var OK=0: byte 12 | public var WARN=1: byte 13 | public var ERROR=2: byte 14 | public var STALE=3: byte 15 | public var level: byte 16 | public var name: string 17 | public var message: string 18 | public var hardware_id: string 19 | public var values: KeyValueMessage[]? = [KeyValueMessage[]]() 20 | 21 | public override init() { 22 | super.init() 23 | values = KeyValueMessage[]() 24 | } 25 | public required init?(map: Map) { 26 | super.init(map: map) 27 | } 28 | 29 | public override func mapping(map: Map) { 30 | OK=0 <- map["OK=0"] 31 | WARN=1 <- map["WARN=1"] 32 | ERROR=2 <- map["ERROR=2"] 33 | STALE=3 <- map["STALE=3"] 34 | level <- map["level"] 35 | name <- map["name"] 36 | message <- map["message"] 37 | hardware_id <- map["hardware_id"] 38 | values <- map["values"] 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018 wesgood 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Sensor/ImageMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ImageMessage.swift 3 | // RBSManager 4 | // 5 | // Created by Wes Goodhoofd on 2020-05-11. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | public class ImageMessage: RBSMessage { 12 | public var header: HeaderMessage? 13 | public var height: UInt32? 14 | public var width: UInt32? 15 | public var encoding: String? 16 | public var isBigendian: UInt8? 17 | public var step: UInt32? 18 | public var data: [UInt8]? 19 | public var encodedData: String? 20 | 21 | public override init() { 22 | super.init() 23 | header = HeaderMessage() 24 | } 25 | 26 | public required init?(map: Map) { 27 | super.init(map: map) 28 | } 29 | 30 | public override func mapping(map: Map) { 31 | header <- map["header"] 32 | height <- map["height"] 33 | width <- map["width"] 34 | encoding <- map["encoding"] 35 | isBigendian <- map["is_bigendian"] 36 | step <- map["step"] 37 | data <- map["data"] 38 | encodedData <- map["data"] 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Example/RBSManager/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ios-marketing", 45 | "size" : "1024x1024", 46 | "scale" : "1x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Tools/msgs/sensor_msgs/NavSatStatusMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NavSatStatusMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class NavSatStatusMessage: RBSMessage { 11 | public var STATUS_NO_FIX: int8 = 0 12 | public var STATUS_FIX: int8 = 0 13 | public var STATUS_SBAS_FIX: int8 = 0 14 | public var STATUS_GBAS_FIX: int8 = 0 15 | public var status: int8 = 0 16 | public var SERVICE_GPS: uint16 = 0 17 | public var SERVICE_GLONASS: uint16 = 0 18 | public var SERVICE_COMPASS: uint16 = 0 19 | public var SERVICE_GALILEO: uint16 = 0 20 | public var service: uint16 = 0 21 | 22 | 23 | public override func mapping(map: Map) { 24 | STATUS_NO_FIX <- map["STATUS_NO_FIX"] 25 | STATUS_FIX <- map["STATUS_FIX"] 26 | STATUS_SBAS_FIX <- map["STATUS_SBAS_FIX"] 27 | STATUS_GBAS_FIX <- map["STATUS_GBAS_FIX"] 28 | status <- map["status"] 29 | SERVICE_GPS <- map["SERVICE_GPS"] 30 | SERVICE_GLONASS <- map["SERVICE_GLONASS"] 31 | SERVICE_COMPASS <- map["SERVICE_COMPASS"] 32 | SERVICE_GALILEO <- map["SERVICE_GALILEO"] 33 | service <- map["service"] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Tools/msgs/stereo_msgs/DisparityImageMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DisparityImageMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class DisparityImageMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var image: ImageMessage? 13 | public var f: float32 = 0 14 | public var T: float32 = 0 15 | public var valid_window: RegionOfInterestMessage? = 0 16 | public var min_disparity: float32 = 0 17 | public var max_disparity: float32 = 0 18 | public var delta_d: float32 = 0 19 | 20 | public override init() { 21 | super.init() 22 | header = HeaderMessage() 23 | image = ImageMessage() 24 | valid_window = RegionOfInterestMessage() 25 | } 26 | public required init?(map: Map) { 27 | super.init(map: map) 28 | } 29 | 30 | public override func mapping(map: Map) { 31 | header <- map["header"] 32 | image <- map["image"] 33 | f <- map["f"] 34 | T <- map["T"] 35 | valid_window <- map["valid_window"] 36 | min_disparity <- map["min_disparity"] 37 | max_disparity <- map["max_disparity"] 38 | delta_d <- map["delta_d"] 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Tools/msgs/sensor_msgs/PointCloud2Message.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PointCloud2Message.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class PointCloud2Message: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var height: uint32 = 0 13 | public var width: uint32 = 0 14 | public var fields: PointFieldMessage[]? = [PointFieldMessage[]]() 15 | public var is_bigendian: bool = false 16 | public var point_step: uint32 = 0 17 | public var row_step: uint32 = 0 18 | public var data: uint8[] = [uint8[]]() 19 | public var is_dense: bool = false 20 | 21 | public override init() { 22 | super.init() 23 | header = HeaderMessage() 24 | fields = PointFieldMessage[]() 25 | } 26 | public required init?(map: Map) { 27 | super.init(map: map) 28 | } 29 | 30 | public override func mapping(map: Map) { 31 | header <- map["header"] 32 | height <- map["height"] 33 | width <- map["width"] 34 | fields <- map["fields"] 35 | is_bigendian <- map["is_bigendian"] 36 | point_step <- map["point_step"] 37 | row_step <- map["row_step"] 38 | data <- map["data"] 39 | is_dense <- map["is_dense"] 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/RBSMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BaseMessage.swift 3 | // Pods 4 | // 5 | // Created by Wes Goodhoofd on 2018-01-06. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | open class RBSMessage: NSObject, Mappable { 12 | public var datePublished: Date? 13 | public var dateReceived: Date? 14 | 15 | public required init?(map: Map) { 16 | super.init() 17 | mapping(map: map) 18 | } 19 | 20 | public override init() {} 21 | 22 | open func mapping(map: Map) { 23 | // overridden 24 | } 25 | 26 | let base64Transform = TransformOf<[UInt8], String>(fromJSON: { (value: String?) -> [UInt8]? in 27 | // string -> array 28 | if value == nil { 29 | return nil 30 | } 31 | 32 | if let data = Data(base64Encoded: value!) { 33 | let array = [UInt8](data) 34 | return array 35 | } else { 36 | return nil 37 | } 38 | }, toJSON: { (value: [UInt8]?) -> String? in 39 | // base 64 to String 40 | if value == nil { 41 | return nil 42 | } 43 | return nil // unnecessary now 44 | }) 45 | } 46 | -------------------------------------------------------------------------------- /Tools/msgs/visualization_msgs/InteractiveMarkerMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // InteractiveMarkerMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class InteractiveMarkerMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var pose: PoseMessage? 13 | public var name: string 14 | public var description: string 15 | public var scale: float32 = 0 16 | public var menu_entries: MenuEntryMessage[]? = [MenuEntryMessage[]]() 17 | public var controls: InteractiveMarkerControlMessage[]? = [InteractiveMarkerControlMessage[]]() 18 | 19 | public override init() { 20 | super.init() 21 | header = HeaderMessage() 22 | pose = PoseMessage() 23 | menu_entries = MenuEntryMessage[]() 24 | controls = InteractiveMarkerControlMessage[]() 25 | } 26 | public required init?(map: Map) { 27 | super.init(map: map) 28 | } 29 | 30 | public override func mapping(map: Map) { 31 | header <- map["header"] 32 | pose <- map["pose"] 33 | name <- map["name"] 34 | description <- map["description"] 35 | scale <- map["scale"] 36 | menu_entries <- map["menu_entries"] 37 | controls <- map["controls"] 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Tools/msgs/visualization_msgs/InteractiveMarkerUpdateMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // InteractiveMarkerUpdateMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class InteractiveMarkerUpdateMessage: RBSMessage { 11 | public var server_id: string 12 | public var seq_num: uint64 = 0 13 | public var KEEP_ALIVE: uint8 = 0 14 | public var UPDATE: uint8 = 0 15 | public var type: uint8 = 0 16 | public var markers: InteractiveMarkerMessage[]? = [InteractiveMarkerMessage[]]() 17 | public var poses: InteractiveMarkerPoseMessage[]? = [InteractiveMarkerPoseMessage[]]() 18 | public var erases: string[] = [string[]]() 19 | 20 | public override init() { 21 | super.init() 22 | markers = InteractiveMarkerMessage[]() 23 | poses = InteractiveMarkerPoseMessage[]() 24 | } 25 | public required init?(map: Map) { 26 | super.init(map: map) 27 | } 28 | 29 | public override func mapping(map: Map) { 30 | server_id <- map["server_id"] 31 | seq_num <- map["seq_num"] 32 | KEEP_ALIVE <- map["KEEP_ALIVE"] 33 | UPDATE <- map["UPDATE"] 34 | type <- map["type"] 35 | markers <- map["markers"] 36 | poses <- map["poses"] 37 | erases <- map["erases"] 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Example/RBSManager/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Tools/msgs/sensor_msgs/ImuMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ImuMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class ImuMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var orientation: QuaternionMessage? 13 | public var orientation_covariance: float64[9] = [float64[9]]() 14 | public var angular_velocity: Vector3Message? 15 | public var angular_velocity_covariance: float64[9] = [float64[9]]() 16 | public var linear_acceleration: Vector3Message? 17 | public var linear_acceleration_covariance: float64[9] = [float64[9]]() 18 | 19 | public override init() { 20 | super.init() 21 | header = HeaderMessage() 22 | orientation = QuaternionMessage() 23 | angular_velocity = Vector3Message() 24 | linear_acceleration = Vector3Message() 25 | } 26 | public required init?(map: Map) { 27 | super.init(map: map) 28 | } 29 | 30 | public override func mapping(map: Map) { 31 | header <- map["header"] 32 | orientation <- map["orientation"] 33 | orientation_covariance <- map["orientation_covariance"] 34 | angular_velocity <- map["angular_velocity"] 35 | angular_velocity_covariance <- map["angular_velocity_covariance"] 36 | linear_acceleration <- map["linear_acceleration"] 37 | linear_acceleration_covariance <- map["linear_acceleration_covariance"] 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Tools/msgs/sensor_msgs/ImageMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ImageMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class ImageMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var Header: # 13 | public var origin: # 14 | public var +x: # 15 | public var +y: # 16 | public var +z: # 17 | public var If: # 18 | public var message: # 19 | public var the: # 20 | public var height: uint32 = 0 21 | public var width: uint32 = 0 22 | public var encoding: string 23 | public var taken: # 24 | public var is_bigendian: uint8 = 0 25 | public var step: uint32 = 0 26 | public var data: uint8[] = [uint8[]]() 27 | 28 | public override init() { 29 | super.init() 30 | header = HeaderMessage() 31 | } 32 | public required init?(map: Map) { 33 | super.init(map: map) 34 | } 35 | 36 | public override func mapping(map: Map) { 37 | header <- map["header"] 38 | Header <- map["Header"] 39 | origin <- map["origin"] 40 | +x <- map["+x"] 41 | +y <- map["+y"] 42 | +z <- map["+z"] 43 | If <- map["If"] 44 | message <- map["message"] 45 | the <- map["the"] 46 | height <- map["height"] 47 | width <- map["width"] 48 | encoding <- map["encoding"] 49 | taken <- map["taken"] 50 | is_bigendian <- map["is_bigendian"] 51 | step <- map["step"] 52 | data <- map["data"] 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Tools/msgs/shape_msgs/SolidPrimitiveMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SolidPrimitiveMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class SolidPrimitiveMessage: RBSMessage { 11 | public var BOX=1: uint8 = 0 12 | public var SPHERE=2: uint8 = 0 13 | public var CYLINDER=3: uint8 = 0 14 | public var CONE=4: uint8 = 0 15 | public var type: uint8 = 0 16 | public var dimensions: float64[] = [float64[]]() 17 | public var BOX_X=0: uint8 = 0 18 | public var BOX_Y=1: uint8 = 0 19 | public var BOX_Z=2: uint8 = 0 20 | public var SPHERE_RADIUS=0: uint8 = 0 21 | public var CYLINDER_HEIGHT=0: uint8 = 0 22 | public var CYLINDER_RADIUS=1: uint8 = 0 23 | public var CONE_HEIGHT=0: uint8 = 0 24 | public var CONE_RADIUS=1: uint8 = 0 25 | 26 | 27 | public override func mapping(map: Map) { 28 | BOX=1 <- map["BOX=1"] 29 | SPHERE=2 <- map["SPHERE=2"] 30 | CYLINDER=3 <- map["CYLINDER=3"] 31 | CONE=4 <- map["CONE=4"] 32 | type <- map["type"] 33 | dimensions <- map["dimensions"] 34 | BOX_X=0 <- map["BOX_X=0"] 35 | BOX_Y=1 <- map["BOX_Y=1"] 36 | BOX_Z=2 <- map["BOX_Z=2"] 37 | SPHERE_RADIUS=0 <- map["SPHERE_RADIUS=0"] 38 | CYLINDER_HEIGHT=0 <- map["CYLINDER_HEIGHT=0"] 39 | CYLINDER_RADIUS=1 <- map["CYLINDER_RADIUS=1"] 40 | CONE_HEIGHT=0 <- map["CONE_HEIGHT=0"] 41 | CONE_RADIUS=1 <- map["CONE_RADIUS=1"] 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Tools/msgs/sensor_msgs/IlluminanceMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IlluminanceMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class IlluminanceMessage: RBSMessage { 11 | public var Single: # 12 | public var measured: # 13 | public var The: # 14 | public var the: # 15 | public var Photometric: # 16 | public var intensity: # 17 | public var All: # 18 | public var not: # 19 | public var This: # 20 | public var Luminous: # 21 | public var Luminance: # 22 | public var Irradiance: # 23 | public var header: HeaderMessage? 24 | public var frame_id: # 25 | public var illuminance: float64 = 0 26 | public var variance: float64 = 0 27 | 28 | public override init() { 29 | super.init() 30 | header = HeaderMessage() 31 | } 32 | public required init?(map: Map) { 33 | super.init(map: map) 34 | } 35 | 36 | public override func mapping(map: Map) { 37 | Single <- map["Single"] 38 | measured <- map["measured"] 39 | The <- map["The"] 40 | the <- map["the"] 41 | Photometric <- map["Photometric"] 42 | intensity <- map["intensity"] 43 | All <- map["All"] 44 | not <- map["not"] 45 | This <- map["This"] 46 | Luminous <- map["Luminous"] 47 | Luminance <- map["Luminance"] 48 | Irradiance <- map["Irradiance"] 49 | header <- map["header"] 50 | frame_id <- map["frame_id"] 51 | illuminance <- map["illuminance"] 52 | variance <- map["variance"] 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Tools/msgs/sensor_msgs/MagneticFieldMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MagneticFieldMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class MagneticFieldMessage: RBSMessage { 11 | public var Measurement: # 12 | public var If: # 13 | public var (if: # 14 | public var put: #just 15 | public var A: # 16 | public var and: # 17 | public var other: # 18 | public var header: HeaderMessage? 19 | public var field: # 20 | public var frame_id: # 21 | public var of: # 22 | public var magnetic_field: Vector3Message? 23 | public var field: # 24 | public var If: # 25 | public var put: # 26 | public var magnetic_field_covariance: float64[9] = [float64[9]]() 27 | public var 0: # 28 | 29 | public override init() { 30 | super.init() 31 | header = HeaderMessage() 32 | magnetic_field = Vector3Message() 33 | } 34 | public required init?(map: Map) { 35 | super.init(map: map) 36 | } 37 | 38 | public override func mapping(map: Map) { 39 | Measurement <- map["Measurement"] 40 | If <- map["If"] 41 | (if <- map["(if"] 42 | put <- map["put"] 43 | A <- map["A"] 44 | and <- map["and"] 45 | other <- map["other"] 46 | header <- map["header"] 47 | field <- map["field"] 48 | frame_id <- map["frame_id"] 49 | of <- map["of"] 50 | magnetic_field <- map["magnetic_field"] 51 | field <- map["field"] 52 | If <- map["If"] 53 | put <- map["put"] 54 | magnetic_field_covariance <- map["magnetic_field_covariance"] 55 | 0 <- map["0"] 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Tools/msgs/sensor_msgs/CameraInfoMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CameraInfoMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class CameraInfoMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var Header: # 13 | public var origin: # 14 | public var +x: # 15 | public var +y: # 16 | public var +z: # 17 | public var height: uint32 = 0 18 | public var width: uint32 = 0 19 | public var distortion_model: string 20 | public var D: float64[] = [float64[]]() 21 | public var K: float64[9] = [float64[9]]() 22 | public var R: float64[9] = [float64[9]]() 23 | public var P: float64[12] = [float64[12]]() 24 | public var binning_x: uint32 = 0 25 | public var binning_y: uint32 = 0 26 | public var roi: RegionOfInterestMessage? = 0 27 | 28 | public override init() { 29 | super.init() 30 | header = HeaderMessage() 31 | roi = RegionOfInterestMessage() 32 | } 33 | public required init?(map: Map) { 34 | super.init(map: map) 35 | } 36 | 37 | public override func mapping(map: Map) { 38 | header <- map["header"] 39 | Header <- map["Header"] 40 | origin <- map["origin"] 41 | +x <- map["+x"] 42 | +y <- map["+y"] 43 | +z <- map["+z"] 44 | height <- map["height"] 45 | width <- map["width"] 46 | distortion_model <- map["distortion_model"] 47 | D <- map["D"] 48 | K <- map["K"] 49 | R <- map["R"] 50 | P <- map["P"] 51 | binning_x <- map["binning_x"] 52 | binning_y <- map["binning_y"] 53 | roi <- map["roi"] 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Tools/msgs/sensor_msgs/NavSatFixMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NavSatFixMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class NavSatFixMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var status: NavSatStatusMessage? 13 | public var latitude: float64 = 0 14 | public var longitude: float64 = 0 15 | public var altitude: float64 = 0 16 | public var position_covariance: float64[9] = [float64[9]]() 17 | public var COVARIANCE_TYPE_UNKNOWN: uint8 = 0 18 | public var COVARIANCE_TYPE_APPROXIMATED: uint8 = 0 19 | public var COVARIANCE_TYPE_DIAGONAL_KNOWN: uint8 = 0 20 | public var COVARIANCE_TYPE_KNOWN: uint8 = 0 21 | public var position_covariance_type: uint8 = 0 22 | 23 | public override init() { 24 | super.init() 25 | header = HeaderMessage() 26 | status = NavSatStatusMessage() 27 | } 28 | public required init?(map: Map) { 29 | super.init(map: map) 30 | } 31 | 32 | public override func mapping(map: Map) { 33 | header <- map["header"] 34 | status <- map["status"] 35 | latitude <- map["latitude"] 36 | longitude <- map["longitude"] 37 | altitude <- map["altitude"] 38 | position_covariance <- map["position_covariance"] 39 | COVARIANCE_TYPE_UNKNOWN <- map["COVARIANCE_TYPE_UNKNOWN"] 40 | COVARIANCE_TYPE_APPROXIMATED <- map["COVARIANCE_TYPE_APPROXIMATED"] 41 | COVARIANCE_TYPE_DIAGONAL_KNOWN <- map["COVARIANCE_TYPE_DIAGONAL_KNOWN"] 42 | COVARIANCE_TYPE_KNOWN <- map["COVARIANCE_TYPE_KNOWN"] 43 | position_covariance_type <- map["position_covariance_type"] 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Tools/msgs/sensor_msgs/LaserScanMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LaserScanMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class LaserScanMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var the: # 13 | public var in: # 14 | public var the: # 15 | public var with: # 16 | public var angle_min: float32 = 0 17 | public var angle_max: float32 = 0 18 | public var angle_increment: float32 = 0 19 | public var time_increment: float32 = 0 20 | public var is: # 21 | public var of: # 22 | public var scan_time: float32 = 0 23 | public var range_min: float32 = 0 24 | public var range_max: float32 = 0 25 | public var ranges: float32[] = [float32[]]() 26 | public var intensities: float32[] = [float32[]]() 27 | public var device: # 28 | public var the: # 29 | 30 | public override init() { 31 | super.init() 32 | header = HeaderMessage() 33 | } 34 | public required init?(map: Map) { 35 | super.init(map: map) 36 | } 37 | 38 | public override func mapping(map: Map) { 39 | header <- map["header"] 40 | the <- map["the"] 41 | in <- map["in"] 42 | the <- map["the"] 43 | with <- map["with"] 44 | angle_min <- map["angle_min"] 45 | angle_max <- map["angle_max"] 46 | angle_increment <- map["angle_increment"] 47 | time_increment <- map["time_increment"] 48 | is <- map["is"] 49 | of <- map["of"] 50 | scan_time <- map["scan_time"] 51 | range_min <- map["range_min"] 52 | range_max <- map["range_max"] 53 | ranges <- map["ranges"] 54 | intensities <- map["intensities"] 55 | device <- map["device"] 56 | the <- map["the"] 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Sensor/ImuMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OrientationMessage.swift 3 | // RBSManager 4 | // 5 | // Created by Wes Goodhoofd on 2020-04-01. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | public class OrientationMessage: RBSMessage { 12 | public var header: HeaderMessage? 13 | public var orientation: QuaternionMessage? 14 | public var angularVelocity: Vector3Message? 15 | public var linearAcceleration: Vector3Message? 16 | 17 | public var orientationCovariance: [Float64]? 18 | public var angularVelocityCovariance: [Float64]? 19 | public var linearAccelerationCovariance: [Float64]? 20 | 21 | public override init() { 22 | super.init() 23 | 24 | header = HeaderMessage() 25 | orientation = QuaternionMessage() 26 | angularVelocity = Vector3Message() 27 | linearAcceleration = Vector3Message() 28 | 29 | orientationCovariance = [Float64]() 30 | angularVelocityCovariance = [Float64]() 31 | linearAccelerationCovariance = [Float64]() 32 | } 33 | 34 | public required init?(map: Map) { 35 | super.init(map: map) 36 | } 37 | 38 | public override func mapping(map: Map) { 39 | header <- map["header"] 40 | orientation <- map["orientation"] 41 | angularVelocity <- map["angular_velocity"] 42 | linearAcceleration <- map["linear_acceleration"] 43 | 44 | orientationCovariance <- map["orientation_covariance"] 45 | angularVelocityCovariance <- map["angular_velocity_covariance"] 46 | linearAccelerationCovariance <- map["linear_acceleration_covariance"] 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Tools/msgs/actionlib_msgs/GoalStatusMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GoalStatusMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class GoalStatusMessage: RBSMessage { 11 | public var goal_id: GoalIDMessage? 12 | public var status: uint8 = 0 13 | public var PENDING: uint8 = 0 14 | public var ACTIVE: uint8 = 0 15 | public var PREEMPTED: uint8 = 0 16 | public var and: # 17 | public var SUCCEEDED: uint8 = 0 18 | public var ABORTED: uint8 = 0 19 | public var to: # 20 | public var REJECTED: uint8 = 0 21 | public var because: # 22 | public var PREEMPTING: uint8 = 0 23 | public var and: # 24 | public var RECALLING: uint8 = 0 25 | public var but: # 26 | public var RECALLED: uint8 = 0 27 | public var and: # 28 | public var LOST: uint8 = 0 29 | public var sent: # 30 | public var text: string 31 | 32 | public override init() { 33 | super.init() 34 | goal_id = GoalIDMessage() 35 | } 36 | public required init?(map: Map) { 37 | super.init(map: map) 38 | } 39 | 40 | public override func mapping(map: Map) { 41 | goal_id <- map["goal_id"] 42 | status <- map["status"] 43 | PENDING <- map["PENDING"] 44 | ACTIVE <- map["ACTIVE"] 45 | PREEMPTED <- map["PREEMPTED"] 46 | and <- map["and"] 47 | SUCCEEDED <- map["SUCCEEDED"] 48 | ABORTED <- map["ABORTED"] 49 | to <- map["to"] 50 | REJECTED <- map["REJECTED"] 51 | because <- map["because"] 52 | PREEMPTING <- map["PREEMPTING"] 53 | and <- map["and"] 54 | RECALLING <- map["RECALLING"] 55 | but <- map["but"] 56 | RECALLED <- map["RECALLED"] 57 | and <- map["and"] 58 | LOST <- map["LOST"] 59 | sent <- map["sent"] 60 | text <- map["text"] 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Tools/msgs/visualization_msgs/InteractiveMarkerFeedbackMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // InteractiveMarkerFeedbackMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class InteractiveMarkerFeedbackMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var client_id: string 13 | public var marker_name: string 14 | public var control_name: string 15 | public var KEEP_ALIVE: uint8 = 0 16 | public var POSE_UPDATE: uint8 = 0 17 | public var MENU_SELECT: uint8 = 0 18 | public var BUTTON_CLICK: uint8 = 0 19 | public var MOUSE_DOWN: uint8 = 0 20 | public var MOUSE_UP: uint8 = 0 21 | public var event_type: uint8 = 0 22 | public var pose: PoseMessage? 23 | public var menu_entry_id: uint32 = 0 24 | public var mouse_point: PointMessage? = 0 25 | public var mouse_point_valid: bool = false 26 | 27 | public override init() { 28 | super.init() 29 | header = HeaderMessage() 30 | pose = PoseMessage() 31 | mouse_point = PointMessage() 32 | } 33 | public required init?(map: Map) { 34 | super.init(map: map) 35 | } 36 | 37 | public override func mapping(map: Map) { 38 | header <- map["header"] 39 | client_id <- map["client_id"] 40 | marker_name <- map["marker_name"] 41 | control_name <- map["control_name"] 42 | KEEP_ALIVE <- map["KEEP_ALIVE"] 43 | POSE_UPDATE <- map["POSE_UPDATE"] 44 | MENU_SELECT <- map["MENU_SELECT"] 45 | BUTTON_CLICK <- map["BUTTON_CLICK"] 46 | MOUSE_DOWN <- map["MOUSE_DOWN"] 47 | MOUSE_UP <- map["MOUSE_UP"] 48 | event_type <- map["event_type"] 49 | pose <- map["pose"] 50 | menu_entry_id <- map["menu_entry_id"] 51 | mouse_point <- map["mouse_point"] 52 | mouse_point_valid <- map["mouse_point_valid"] 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /RBSManager/Classes/RBSResponse.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RBSResponse.swift 3 | // RBSManager 4 | // 5 | // Created by Wes Goodhoofd on 2019-08-04. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | public enum ROSBridgeOperation: String { 12 | case publish = "publish" 13 | case serviceResponse = "service_response" 14 | } 15 | public class RBSResponse: NSObject, Mappable { 16 | public var service: String? 17 | public var topic: String? 18 | public var id: String? 19 | public var operation: ROSBridgeOperation? 20 | public var result: Int? 21 | public var values: Any? 22 | public var message: [String : Any]? 23 | 24 | required public init?(map: Map) { 25 | } 26 | 27 | public func mapping(map: Map) { 28 | service <- map["service"] 29 | topic <- map["topic"] 30 | id <- map["id"] 31 | operation <- map["op"] 32 | result <- map["result"] 33 | values <- map["values"] 34 | message <- map["msg"] 35 | } 36 | 37 | public func getFloatParameter() -> Float? { 38 | if let valuesObject = values as? [String : Any] { 39 | if let value = valuesObject["value"] as? NSString, value.lowercased != "null" { 40 | return value.floatValue 41 | } else { 42 | return nil 43 | } 44 | } else { 45 | return nil 46 | } 47 | } 48 | 49 | public func getStringParameter() -> String? { 50 | if let valuesObject = values as? [String : Any] { 51 | if let value = valuesObject["value"] as? String { 52 | return value 53 | } else { 54 | return nil 55 | } 56 | } else { 57 | return nil 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Tools/msgs/sensor_msgs/MultiEchoLaserScanMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MultiEchoLaserScanMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class MultiEchoLaserScanMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var the: # 13 | public var in: # 14 | public var the: # 15 | public var with: # 16 | public var angle_min: float32 = 0 17 | public var angle_max: float32 = 0 18 | public var angle_increment: float32 = 0 19 | public var time_increment: float32 = 0 20 | public var is: # 21 | public var of: # 22 | public var scan_time: float32 = 0 23 | public var range_min: float32 = 0 24 | public var range_max: float32 = 0 25 | public var ranges: LaserEchoMessage[]? = [LaserEchoMessage[]]() 26 | public var +Inf: # 27 | public var -Inf: # 28 | public var intensities: LaserEchoMessage[]? = [LaserEchoMessage[]]() 29 | public var device: # 30 | public var the: # 31 | 32 | public override init() { 33 | super.init() 34 | header = HeaderMessage() 35 | ranges = LaserEchoMessage[]() 36 | intensities = LaserEchoMessage[]() 37 | } 38 | public required init?(map: Map) { 39 | super.init(map: map) 40 | } 41 | 42 | public override func mapping(map: Map) { 43 | header <- map["header"] 44 | the <- map["the"] 45 | in <- map["in"] 46 | the <- map["the"] 47 | with <- map["with"] 48 | angle_min <- map["angle_min"] 49 | angle_max <- map["angle_max"] 50 | angle_increment <- map["angle_increment"] 51 | time_increment <- map["time_increment"] 52 | is <- map["is"] 53 | of <- map["of"] 54 | scan_time <- map["scan_time"] 55 | range_min <- map["range_min"] 56 | range_max <- map["range_max"] 57 | ranges <- map["ranges"] 58 | +Inf <- map["+Inf"] 59 | -Inf <- map["-Inf"] 60 | intensities <- map["intensities"] 61 | device <- map["device"] 62 | the <- map["the"] 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Tools/msgs/sensor_msgs/RangeMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RangeMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class RangeMessage: RBSMessage { 11 | public var header: HeaderMessage? 12 | public var returned: # 13 | public var ULTRASOUND=0: uint8 = 0 14 | public var INFRARED=1: uint8 = 0 15 | public var radiation_type: uint8 = 0 16 | public var (sound,: # 17 | public var field_of_view: float32 = 0 18 | public var valid: # 19 | public var the: # 20 | public var been: # 21 | public var field_of_view/2: # 22 | public var 0: # 23 | public var min_range: float32 = 0 24 | public var max_range: float32 = 0 25 | public var Fixed: # 26 | public var range: float32 = 0 27 | public var (Note:: # 28 | public var should: # 29 | public var Fixed: # 30 | public var -Inf: # 31 | public var (Detection: # 32 | public var +Inf: # 33 | public var (Object: # 34 | 35 | public override init() { 36 | super.init() 37 | header = HeaderMessage() 38 | } 39 | public required init?(map: Map) { 40 | super.init(map: map) 41 | } 42 | 43 | public override func mapping(map: Map) { 44 | header <- map["header"] 45 | returned <- map["returned"] 46 | ULTRASOUND=0 <- map["ULTRASOUND=0"] 47 | INFRARED=1 <- map["INFRARED=1"] 48 | radiation_type <- map["radiation_type"] 49 | (sound, <- map["(sound,"] 50 | field_of_view <- map["field_of_view"] 51 | valid <- map["valid"] 52 | the <- map["the"] 53 | been <- map["been"] 54 | field_of_view/2 <- map["field_of_view/2"] 55 | 0 <- map["0"] 56 | min_range <- map["min_range"] 57 | max_range <- map["max_range"] 58 | Fixed <- map["Fixed"] 59 | range <- map["range"] 60 | (Note: <- map["(Note:"] 61 | should <- map["should"] 62 | Fixed <- map["Fixed"] 63 | -Inf <- map["-Inf"] 64 | (Detection <- map["(Detection"] 65 | +Inf <- map["+Inf"] 66 | (Object <- map["(Object"] 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /RBSManager.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint RBSManager.podspec' to ensure this is a 3 | # valid spec before submitting. 4 | # 5 | # Any lines starting with a # are optional, but their use is encouraged 6 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | s.name = 'RBSManager' 11 | s.version = '0.4' 12 | s.summary = 'RBSManager is a Swift native tool to connect to ROSBridge servers using Websockets.' 13 | 14 | # This description is used to generate tags and improve search results. 15 | # * Think: What does it do? Why did you write it? What is the focus? 16 | # * Try to keep it short, snappy and to the point. 17 | # * Write the description between the DESC delimiters below. 18 | # * Finally, don't worry about the indent, CocoaPods strips it! 19 | 20 | s.description = <<-DESC 21 | RBSManager is a continuation of my previous project, RBManager, to provide an iOS compatible library to make mobile connections to ROS easier. By handling the socket connection, JSON serialization and message processing automatically, users can get back to making their robots more useful. 22 | DESC 23 | 24 | s.homepage = 'https://github.com/wesgood/RBSManager' 25 | # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' 26 | s.license = { :type => 'MIT', :file => 'LICENSE' } 27 | s.author = { 'wesgood' => 'w@wesg.ca' } 28 | s.source = { :git => 'https://github.com/wesgood/RBSManager.git', :tag => s.version.to_s } 29 | s.social_media_url = 'https://twitter.com/wesgood' 30 | s.swift_version = '5.0' 31 | 32 | s.ios.deployment_target = '10.0' 33 | 34 | s.source_files = 'RBSManager/Classes/**/*' 35 | 36 | # s.resource_bundles = { 37 | # 'RBSManager' => ['RBSManager/Assets/*.png'] 38 | # } 39 | 40 | # s.public_header_files = 'Pod/Classes/**/*.h' 41 | # s.frameworks = 'UIKit', 'MapKit' 42 | s.dependency 'Starscream', '~> 3.1.1' 43 | s.dependency 'ObjectMapper', '~> 4.2' 44 | end 45 | -------------------------------------------------------------------------------- /Tools/msgs/visualization_msgs/ImageMarkerMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ImageMarkerMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class ImageMarkerMessage: RBSMessage { 11 | public var CIRCLE=0: uint8 = 0 12 | public var LINE_STRIP=1: uint8 = 0 13 | public var LINE_LIST=2: uint8 = 0 14 | public var POLYGON=3: uint8 = 0 15 | public var POINTS=4: uint8 = 0 16 | public var ADD=0: uint8 = 0 17 | public var REMOVE=1: uint8 = 0 18 | public var header: HeaderMessage? 19 | public var ns: string 20 | public var id: int32 = 0 21 | public var type: int32 = 0 22 | public var action: int32 = 0 23 | public var position: PointMessage? = 0 24 | public var scale: float32 = 0 25 | public var outline_color: ColorRGBAMessage? 26 | public var filled: uint8 = 0 27 | public var fill_color: ColorRGBAMessage? 28 | public var lifetime: duration 29 | public var points: PointMessage[]? = [PointMessage[]]() 30 | public var outline_colors: ColorRGBAMessage[]? = [ColorRGBAMessage[]]() 31 | 32 | public override init() { 33 | super.init() 34 | header = HeaderMessage() 35 | position = PointMessage() 36 | outline_color = ColorRGBAMessage() 37 | fill_color = ColorRGBAMessage() 38 | points = PointMessage[]() 39 | outline_colors = ColorRGBAMessage[]() 40 | } 41 | public required init?(map: Map) { 42 | super.init(map: map) 43 | } 44 | 45 | public override func mapping(map: Map) { 46 | CIRCLE=0 <- map["CIRCLE=0"] 47 | LINE_STRIP=1 <- map["LINE_STRIP=1"] 48 | LINE_LIST=2 <- map["LINE_LIST=2"] 49 | POLYGON=3 <- map["POLYGON=3"] 50 | POINTS=4 <- map["POINTS=4"] 51 | ADD=0 <- map["ADD=0"] 52 | REMOVE=1 <- map["REMOVE=1"] 53 | header <- map["header"] 54 | ns <- map["ns"] 55 | id <- map["id"] 56 | type <- map["type"] 57 | action <- map["action"] 58 | position <- map["position"] 59 | scale <- map["scale"] 60 | outline_color <- map["outline_color"] 61 | filled <- map["filled"] 62 | fill_color <- map["fill_color"] 63 | lifetime <- map["lifetime"] 64 | points <- map["points"] 65 | outline_colors <- map["outline_colors"] 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Tools/msgs/visualization_msgs/InteractiveMarkerControlMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // InteractiveMarkerControlMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class InteractiveMarkerControlMessage: RBSMessage { 11 | public var name: string 12 | public var orientation: QuaternionMessage? 13 | public var INHERIT: uint8 = 0 14 | public var FIXED: uint8 = 0 15 | public var VIEW_FACING: uint8 = 0 16 | public var orientation_mode: uint8 = 0 17 | public var NONE: uint8 = 0 18 | public var MENU: uint8 = 0 19 | public var BUTTON: uint8 = 0 20 | public var MOVE_AXIS: uint8 = 0 21 | public var MOVE_PLANE: uint8 = 0 22 | public var ROTATE_AXIS: uint8 = 0 23 | public var MOVE_ROTATE: uint8 = 0 24 | public var MOVE_3D: uint8 = 0 25 | public var ROTATE_3D: uint8 = 0 26 | public var MOVE_ROTATE_3D: uint8 = 0 27 | public var interaction_mode: uint8 = 0 28 | public var always_visible: bool = false 29 | public var markers: MarkerMessage[]? = [MarkerMessage[]]() 30 | public var independent_marker_orientation: bool = false 31 | public var description: string 32 | 33 | public override init() { 34 | super.init() 35 | orientation = QuaternionMessage() 36 | markers = MarkerMessage[]() 37 | } 38 | public required init?(map: Map) { 39 | super.init(map: map) 40 | } 41 | 42 | public override func mapping(map: Map) { 43 | name <- map["name"] 44 | orientation <- map["orientation"] 45 | INHERIT <- map["INHERIT"] 46 | FIXED <- map["FIXED"] 47 | VIEW_FACING <- map["VIEW_FACING"] 48 | orientation_mode <- map["orientation_mode"] 49 | NONE <- map["NONE"] 50 | MENU <- map["MENU"] 51 | BUTTON <- map["BUTTON"] 52 | MOVE_AXIS <- map["MOVE_AXIS"] 53 | MOVE_PLANE <- map["MOVE_PLANE"] 54 | ROTATE_AXIS <- map["ROTATE_AXIS"] 55 | MOVE_ROTATE <- map["MOVE_ROTATE"] 56 | MOVE_3D <- map["MOVE_3D"] 57 | ROTATE_3D <- map["ROTATE_3D"] 58 | MOVE_ROTATE_3D <- map["MOVE_ROTATE_3D"] 59 | interaction_mode <- map["interaction_mode"] 60 | always_visible <- map["always_visible"] 61 | markers <- map["markers"] 62 | independent_marker_orientation <- map["independent_marker_orientation"] 63 | description <- map["description"] 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Sensor/NavSatFixMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NavSatFixMessage.swift 3 | // ObjectMapper 4 | // 5 | // Created by Wes Goodhoofd on 2019-07-13. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | import CoreLocation 11 | 12 | public enum PositionCovarianceType: UInt8 { 13 | case COVARIANCE_TYPE_UNKNOWN = 0 14 | case COVARIANCE_TYPE_APPROXIMATED = 1 15 | case COVARIANCE_TYPE_DIAGONAL_KNOWN = 2 16 | case COVARIANCE_TYPE_KNOWN = 3 17 | } 18 | 19 | public class NavSatFixMessage: RBSMessage { 20 | public var header: HeaderMessage? 21 | public var status: NavSatStatusMessage? 22 | public var latitude: Float64 = 0 23 | public var longitude: Float64 = 0 24 | public var altitude: Float64 = 0 25 | public var position_covariance: [Float64]? 26 | public var position_covariance_type: PositionCovarianceType? 27 | 28 | public override init() { 29 | super.init() 30 | header = HeaderMessage() 31 | status = NavSatStatusMessage() 32 | } 33 | 34 | public required init?(map: Map) { 35 | super.init(map: map) 36 | } 37 | 38 | override public func mapping(map: Map) { 39 | header <- map["header"] 40 | status <- map["status"] 41 | latitude <- map["latitude"] 42 | longitude <- map["longitude"] 43 | altitude <- map["altitude"] 44 | position_covariance <- map["position_covariance"] 45 | position_covariance_type <- map["position_covariance_type"] 46 | } 47 | 48 | public func latitudeLabel() -> String? { 49 | let quadrant = (latitude > 0) ? "N" : "S" 50 | return String(format: "%.4f %@", latitude, quadrant) 51 | } 52 | 53 | public func longitudeLabel() -> String? { 54 | let quadrant = (longitude > 0) ? "E" : "W" 55 | return String(format: "%.4f %@", longitude, quadrant) 56 | } 57 | 58 | public func coordinate() -> CLLocationCoordinate2D { 59 | return CLLocationCoordinate2D(latitude: latitude, longitude: longitude) 60 | } 61 | 62 | public func hasFix() -> Bool { 63 | if let fix = status?.status { 64 | return fix.rawValue > NavSatStatus.STATUS_NO_FIX.rawValue 65 | } else { 66 | return false 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /RBSManager/Classes/RBSServiceCall.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RBSServiceCall.swift 3 | // Pods 4 | // 5 | // Created by Wes Goodhoofd on 2018-01-06. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | public class RBSServiceCall: NSObject { 12 | var manager: RBSManager 13 | public var service: String 14 | public var dataArgument: [String : Any]? 15 | public var messageArgument: Mappable? 16 | public var arrayArgument: [Any]? 17 | var responseCallback: ((_ data: RBSResponse) -> (Void))? 18 | 19 | // ROS specific options 20 | public var fragmentSize: Int? 21 | public var compression: String? 22 | public var serviceId: String? 23 | 24 | init(manager m: RBSManager, service s: String) { 25 | self.manager = m 26 | self.service = s 27 | } 28 | 29 | /// send a service call and optionally handle the response 30 | public func send(_ response: ((_ data: RBSResponse) -> (Void))?) { 31 | self.responseCallback = response 32 | 33 | // build the dictionary to send to ROS 34 | var data = [String : Any]() 35 | data["op"] = "call_service" 36 | data["service"] = self.service 37 | 38 | // add options to configure the subscriber 39 | if let argumentOption = dataArgument { 40 | data["args"] = argumentOption 41 | } else if let argumentOption = messageArgument { 42 | let jsonObject = argumentOption.toJSON() 43 | data["args"] = jsonObject 44 | } else if let argumentOption = arrayArgument { 45 | data["args"] = argumentOption 46 | } 47 | 48 | // force service call ID assignment - this allows multiple service calls 49 | // if serviceId == nil { 50 | // serviceId = manager.randomString(length: 8) 51 | // } 52 | data["id"] = serviceId 53 | 54 | if let fragmentSizeOption = fragmentSize { 55 | data["fragment_size"] = String(describing: fragmentSizeOption) 56 | } 57 | 58 | if let compressionOption = compression { 59 | data["compression"] = compressionOption 60 | } 61 | 62 | // pass the data to the manager 63 | self.manager.sendData(dictionary: data) 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Example/RBSManager/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // RBSManager 4 | // 5 | // Created by wesgood on 01/06/2018. 6 | // Copyright (c) 2018 wesgood. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /RBSManager/Classes/RBSPublisher.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RBSPublisher.swift 3 | // Pods 4 | // 5 | // Created by Wes Goodhoofd on 2018-01-06. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | public class RBSPublisher: NSObject { 12 | var manager: RBSManager 13 | public var messageClass: RBSMessage.Type 14 | public var messageType: String 15 | public var topic: String 16 | 17 | // configuration options 18 | public var active: Bool = true 19 | public var connected: Bool = false 20 | public var tag: String? 21 | 22 | // ROS specific options 23 | public var publisherId: String? 24 | 25 | init(manager m: RBSManager, topic t: String, messageType mt: String, messageClass mc: RBSMessage.Type) { 26 | self.manager = m 27 | self.topic = t 28 | self.messageClass = mc 29 | self.messageType = mt 30 | } 31 | 32 | /// add the message to a container and send to manager for transmit 33 | public func publish(_ message: RBSMessage) { 34 | let container = RBSMessageContainer(message, topic: topic) 35 | 36 | if let publisherIdOption = publisherId { 37 | container.publisherId = publisherIdOption 38 | } 39 | 40 | self.manager.sendData(object: container) 41 | } 42 | 43 | /// advertise this publisher on ROS 44 | public func advertise() { 45 | self.connected = true 46 | 47 | var data = [ 48 | "op" : "advertise", 49 | "topic" : self.topic, 50 | "type" : self.messageType, 51 | ] 52 | 53 | // force publisher ID assignment - this allows multiple publishers 54 | // if publisherId == nil { 55 | // publisherId = manager.randomString(length: 8) 56 | // } 57 | data["id"] = publisherId 58 | 59 | self.manager.sendData(dictionary: data) 60 | } 61 | 62 | /// remove this publisher from ROS to stop sending messages 63 | public func unadvertise() { 64 | self.connected = false 65 | 66 | var data = [ 67 | "op" : "unadvertise", 68 | "topic" : self.topic 69 | ] 70 | 71 | if let publisherIdOption = publisherId { 72 | data["id"] = publisherIdOption 73 | } 74 | 75 | self.manager.sendData(dictionary: data) 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /Tools/msgs/visualization_msgs/MarkerMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MarkerMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class MarkerMessage: RBSMessage { 11 | public var ARROW=0: uint8 = 0 12 | public var CUBE=1: uint8 = 0 13 | public var SPHERE=2: uint8 = 0 14 | public var CYLINDER=3: uint8 = 0 15 | public var LINE_STRIP=4: uint8 = 0 16 | public var LINE_LIST=5: uint8 = 0 17 | public var CUBE_LIST=6: uint8 = 0 18 | public var SPHERE_LIST=7: uint8 = 0 19 | public var POINTS=8: uint8 = 0 20 | public var TEXT_VIEW_FACING=9: uint8 = 0 21 | public var MESH_RESOURCE=10: uint8 = 0 22 | public var TRIANGLE_LIST=11: uint8 = 0 23 | public var ADD=0: uint8 = 0 24 | public var MODIFY=0: uint8 = 0 25 | public var DELETE=2: uint8 = 0 26 | public var DELETEALL=3: uint8 = 0 27 | public var header: HeaderMessage? 28 | public var ns: string 29 | public var id: int32 = 0 30 | public var type: int32 = 0 31 | public var action: int32 = 0 32 | public var pose: PoseMessage? 33 | public var scale: Vector3Message? 34 | public var color: ColorRGBAMessage? 35 | public var lifetime: duration 36 | public var frame_locked: bool = false 37 | public var points: PointMessage[]? = [PointMessage[]]() 38 | public var colors: ColorRGBAMessage[]? = [ColorRGBAMessage[]]() 39 | public var text: string 40 | public var mesh_resource: string 41 | public var mesh_use_embedded_materials: bool = false 42 | 43 | public override init() { 44 | super.init() 45 | header = HeaderMessage() 46 | pose = PoseMessage() 47 | scale = Vector3Message() 48 | color = ColorRGBAMessage() 49 | points = PointMessage[]() 50 | colors = ColorRGBAMessage[]() 51 | } 52 | public required init?(map: Map) { 53 | super.init(map: map) 54 | } 55 | 56 | public override func mapping(map: Map) { 57 | ARROW=0 <- map["ARROW=0"] 58 | CUBE=1 <- map["CUBE=1"] 59 | SPHERE=2 <- map["SPHERE=2"] 60 | CYLINDER=3 <- map["CYLINDER=3"] 61 | LINE_STRIP=4 <- map["LINE_STRIP=4"] 62 | LINE_LIST=5 <- map["LINE_LIST=5"] 63 | CUBE_LIST=6 <- map["CUBE_LIST=6"] 64 | SPHERE_LIST=7 <- map["SPHERE_LIST=7"] 65 | POINTS=8 <- map["POINTS=8"] 66 | TEXT_VIEW_FACING=9 <- map["TEXT_VIEW_FACING=9"] 67 | MESH_RESOURCE=10 <- map["MESH_RESOURCE=10"] 68 | TRIANGLE_LIST=11 <- map["TRIANGLE_LIST=11"] 69 | ADD=0 <- map["ADD=0"] 70 | MODIFY=0 <- map["MODIFY=0"] 71 | DELETE=2 <- map["DELETE=2"] 72 | DELETEALL=3 <- map["DELETEALL=3"] 73 | header <- map["header"] 74 | ns <- map["ns"] 75 | id <- map["id"] 76 | type <- map["type"] 77 | action <- map["action"] 78 | pose <- map["pose"] 79 | scale <- map["scale"] 80 | color <- map["color"] 81 | lifetime <- map["lifetime"] 82 | frame_locked <- map["frame_locked"] 83 | points <- map["points"] 84 | colors <- map["colors"] 85 | text <- map["text"] 86 | mesh_resource <- map["mesh_resource"] 87 | mesh_use_embedded_materials <- map["mesh_use_embedded_materials"] 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /RBSManager/Classes/RBSSubscriber.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RBSSubscriber.swift 3 | // Pods 4 | // 5 | // Created by Wes Goodhoofd on 2018-01-06. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | public class RBSSubscriber: NSObject { 12 | var manager: RBSManager 13 | public var messageClass: RBSMessage.Type 14 | public var topic: String 15 | var callback: ((_ message: RBSMessage) -> (Void)) 16 | 17 | // configuration options 18 | public var active: Bool = true 19 | public var connected: Bool = false 20 | public var tag: String? 21 | 22 | // ROS specific options 23 | public var messageType: String? 24 | public var subscriberId: String? 25 | public var throttleRate: Int? 26 | public var queueLength: Int? 27 | public var fragmentSize: Int? 28 | public var compression: String? 29 | 30 | init(manager m: RBSManager, topic t: String, messageClass mc: RBSMessage.Type, callback c: @escaping (_ message: RBSMessage) -> (Void)) { 31 | self.manager = m 32 | self.topic = t 33 | self.messageClass = mc 34 | self.callback = c 35 | } 36 | 37 | /// Tell ROSBridge to begin passing messages when they are received 38 | public func subscribe() { 39 | self.connected = true 40 | 41 | // build the dictionary to send to ROS 42 | var data = [String : Any]() 43 | data["op"] = "subscribe" 44 | data["topic"] = self.topic 45 | 46 | // add options to configure the subscriber 47 | if let messageTypeOption = messageType { 48 | data["type"] = messageTypeOption 49 | } 50 | 51 | // force subscriber ID assignment - this allows multiple subscribers 52 | // if subscriberId == nil { 53 | // subscriberId = manager.randomString(length: 8) 54 | // } 55 | data["id"] = subscriberId 56 | 57 | if let throttleRateOption = throttleRate { 58 | data["throttle_rate"] = throttleRateOption 59 | } 60 | 61 | if let queueLengthOption = queueLength { 62 | data["queue_length"] = queueLengthOption 63 | } 64 | 65 | if let fragmentSizeOption = fragmentSize { 66 | data["fragment_size"] = fragmentSizeOption 67 | } 68 | 69 | if let compressionOption = compression { 70 | data["compression"] = compressionOption 71 | } 72 | 73 | // pass the data to the manager 74 | self.manager.sendData(dictionary: data) 75 | } 76 | 77 | /// Tell ROS to stop sending messages 78 | public func unsubscribe() { 79 | self.connected = false 80 | 81 | var data = [ 82 | "op" : "unsubscribe", 83 | "topic" : self.topic 84 | ] 85 | 86 | if let subscriberIdOption = subscriberId { 87 | data["id"] = subscriberIdOption 88 | } 89 | 90 | self.manager.sendData(dictionary: data) 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /RBSManager/Classes/Messages/Sensor/BatteryStateMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BatteryStateMessage.swift 3 | // RBSManager 4 | // 5 | // Created by Wes Goodhoofd on 2019-07-26. 6 | // 7 | 8 | import UIKit 9 | import ObjectMapper 10 | 11 | public enum PowerSupplyStatus: UInt8 { 12 | case POWER_SUPPLY_STATUS_UNKNOWN = 0 13 | case POWER_SUPPLY_STATUS_CHARGING 14 | case POWER_SUPPLY_STATUS_DISCHARGING 15 | case POWER_SUPPLY_STATUS_NOT_CHARGING 16 | case POWER_SUPPLY_STATUS_FULL 17 | } 18 | 19 | public enum PowerSupplyHealth: UInt8 { 20 | case POWER_SUPPLY_HEALTH_UNKNOWN = 0 21 | case POWER_SUPPLY_HEALTH_GOOD = 1 22 | case POWER_SUPPLY_HEALTH_OVERHEAT = 2 23 | case POWER_SUPPLY_HEALTH_DEAD = 3 24 | case POWER_SUPPLY_HEALTH_OVERVOLTAGE = 4 25 | case POWER_SUPPLY_HEALTH_UNSPEC_FAILURE = 5 26 | case POWER_SUPPLY_HEALTH_COLD = 6 27 | case POWER_SUPPLY_HEALTH_WATCHDOG_TIMER_EXPIRE = 7 28 | case POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE = 8 29 | } 30 | 31 | public enum PowerSupplyTechnology: UInt8 { 32 | case POWER_SUPPLY_TECHNOLOGY_UNKNOWN = 0 33 | case POWER_SUPPLY_TECHNOLOGY_NIMH = 1 34 | case POWER_SUPPLY_TECHNOLOGY_LION = 2 35 | case POWER_SUPPLY_TECHNOLOGY_LIPO = 3 36 | case POWER_SUPPLY_TECHNOLOGY_LIFE = 4 37 | case POWER_SUPPLY_TECHNOLOGY_NICD = 5 38 | case POWER_SUPPLY_TECHNOLOGY_LIMN = 6 39 | } 40 | 41 | public class BatteryStateMessage: RBSMessage { 42 | public var header: HeaderMessage? 43 | public var voltage: Float32 = 0 44 | public var current: Float32 = 0 45 | public var charge: Float32 = 0 46 | public var capacity: Float32 = 0 47 | public var design_capacity: Float32 = 0 48 | public var percentage: Float32 = 0 49 | public var power_supply_health: PowerSupplyHealth = .POWER_SUPPLY_HEALTH_UNKNOWN 50 | public var power_supply_status: PowerSupplyStatus = .POWER_SUPPLY_STATUS_UNKNOWN 51 | public var power_supply_technology: PowerSupplyTechnology = .POWER_SUPPLY_TECHNOLOGY_UNKNOWN 52 | public var present: Bool = false 53 | public var cell_voltage: [Float32]? 54 | public var location: String? 55 | public var serial_number: String? 56 | 57 | public override init() { 58 | super.init() 59 | header = HeaderMessage() 60 | } 61 | 62 | public required init?(map: Map) { 63 | super.init(map: map) 64 | } 65 | 66 | override public func mapping(map: Map) { 67 | header <- map["header"] 68 | voltage <- map["voltage"] 69 | current <- map["current"] 70 | charge <- map["charge"] 71 | capacity <- map["capacity"] 72 | design_capacity <- map["design_capacity"] 73 | percentage <- map["percentage"] 74 | power_supply_health <- map["power_supply_health"] 75 | power_supply_status <- map["power_supply_status"] 76 | power_supply_technology <- map["power_supply_technology"] 77 | present <- map["present"] 78 | //cell_voltage <- map["cell_voltage"] 79 | location <- map["location"] 80 | serial_number <- map["serial_number"] 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /Tools/custom_messages.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | ##### 4 | # 5 | # Written by Wes Goodhoofd -- w@wesg.ca 6 | # Date September 19, 2018 7 | # 8 | # A tool to generate ROS messages by accepting parameters 9 | # 10 | ##### 11 | 12 | import argparse 13 | import datetime 14 | import getpass 15 | 16 | def createMessageFile(path, className, variables): 17 | # create the actual file 18 | now = datetime.datetime.now() 19 | 20 | # generate the Swift placeholders 21 | 22 | placeholders = { 23 | 'class_name' : className, 24 | 'author' : getpass.getuser(), 25 | 'date' : "%02d-%02d-%d" % (now.year, now.month, now.day), 26 | 'init' : '' 27 | } 28 | 29 | instanceVariables = [] 30 | mappingVariables = [] 31 | initVariables = [] 32 | 33 | for variable in variables: 34 | instanceLine = "public var %s: %s" % (variable[0], variable[1]) 35 | 36 | # handle the init case 37 | if "message" in variable[1].lower(): 38 | initLine = "%s = %s()" % (variable[0], variable[1]) 39 | initVariables.append(initLine) 40 | instanceLine += "?" 41 | 42 | if "[" in variable[1] or "]" in variable[1]: 43 | instanceLine += " = ["+variable[1]+"]()" 44 | elif "float" in variable[1].lower() or "int" in variable[1].lower(): 45 | instanceLine += " = 0" 46 | elif "bool" in variable[1].lower(): 47 | instanceLine += " = false" 48 | 49 | instanceVariables.append(instanceLine) 50 | mappingVariables.append("%s <- map[\"%s\"]" % (variable[0], variable[0])) 51 | 52 | 53 | if len(instanceVariables) > 1: 54 | placeholders['variables'] = "\n\t".join(instanceVariables) 55 | elif len(instanceVariables) > 0: 56 | placeholders['variables'] = instanceVariables[0] 57 | else: 58 | placeholders['variables'] = "" 59 | 60 | if len(instanceVariables) > 1: 61 | placeholders['mapping'] = "\n\t\t".join(mappingVariables) 62 | elif len(mappingVariables) > 0: 63 | placeholders['mapping'] = mappingVariables[0] 64 | else: 65 | placeholders['mapping'] = "" 66 | 67 | if len(initVariables) > 0: 68 | initMethod = "\n\tpublic override init() {\n\t\tsuper.init()\n\t\t" 69 | initMethod += "\n\t".join(initVariables) 70 | initMethod += "\n\t}\n\t" 71 | initMethod += "public required init?(map: Map) {\n\t\tsuper.init(map: map)\n\t}" 72 | 73 | placeholders['init'] = initMethod 74 | 75 | # load the blank message 76 | with open('BlankMessage.swift', 'r') as myfile: 77 | messageContent = myfile.read() 78 | 79 | # replace the placeholders 80 | if messageContent is not None: 81 | for key,value in placeholders.items(): 82 | # print "%s -> %s" % (key, value) 83 | messageContent = messageContent.replace('['+key+']', value) 84 | 85 | # save the file 86 | text_file = open(path, "w") 87 | text_file.write(messageContent) 88 | text_file.close() 89 | 90 | if __name__ == '__main__': 91 | # process parameters 92 | parser = argparse.ArgumentParser(description='Generate custom ROS messages.') 93 | parser.add_argument("class_name") 94 | parser.add_argument("variables", nargs='+') 95 | args = parser.parse_args() 96 | 97 | # process the variables 98 | variables = [] 99 | for entry in args.variables: 100 | variables.append(entry.split(':')) 101 | 102 | # folder 103 | filepath = os.path.realpath("%s.swift" % args.class_name) 104 | 105 | createMessageFile(filepath, args.class_name, variables) -------------------------------------------------------------------------------- /Example/RBSManager/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 25 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /Example/RBSManager/ColorPickerView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ColorPickerView.swift 3 | // RBSManager_Example 4 | // 5 | // Created by Wes Goodhoofd on 2018-01-17. 6 | // Copyright © 2018 CocoaPods. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | protocol ColorPickerDelegate { 12 | func didSelectColour(picker: ColorPickerView, colour: UIColor?) 13 | } 14 | 15 | class ColorPickerView: ModalContainerView { 16 | var redSlider: UISlider? 17 | var greenSlider: UISlider? 18 | var blueSlider: UISlider? 19 | var colourView: UIView? 20 | var colourDelegate: ColorPickerDelegate? 21 | var selectedColor: UIColor? 22 | 23 | // view info 24 | var viewHeight: CGFloat = 0 25 | 26 | convenience init(colour c: UIColor?) { 27 | self.init() 28 | selectedColor = c 29 | } 30 | 31 | override func getRightButton() -> UIButton? { 32 | let button = createBottomButton(title: "Go", color: ModalContainerView.greenColour) 33 | button.addTarget(self, action: #selector(onGoButton), for: .touchUpInside) 34 | return button 35 | } 36 | 37 | override func getLeftButton() -> UIButton? { 38 | return nil 39 | } 40 | 41 | override func getTitle() -> String? { 42 | return "Background colour" 43 | } 44 | 45 | override func getMainView(_ availableSize: CGSize) -> UIView? { 46 | let view = UIView() 47 | let viewWidth: CGFloat = availableSize.width-20 48 | view.frame = CGRect(origin: CGPoint.zero, size: CGSize(width: viewWidth, height: 0)) 49 | 50 | // build the views in order 51 | colourView = UIView(frame: CGRect(origin: CGPoint.zero, size: CGSize(width: viewWidth/3.0, height: viewWidth/3.0))) 52 | colourView?.backgroundColor = (selectedColor != nil) ? selectedColor : UIColor.black 53 | colourView?.center = CGPoint(x: viewWidth/2, y: colourView!.frame.size.height/2 + 10) 54 | view.addSubview(colourView!) 55 | viewHeight += colourView!.frame.maxY + 10 56 | 57 | redSlider = createSlider("Red", view: view) 58 | greenSlider = createSlider("Green", view: view) 59 | blueSlider = createSlider("Blue", view: view) 60 | 61 | if let colourObject = selectedColor { 62 | let rgbColour = colourObject.cgColor 63 | if let rgbColours = rgbColour.components { 64 | redSlider?.value = Float(rgbColours[0]) 65 | greenSlider?.value = Float(rgbColours[1]) 66 | blueSlider?.value = Float(rgbColours[2]) 67 | } 68 | } 69 | 70 | view.frame = CGRect(origin: CGPoint.zero, size: CGSize(width: viewWidth, height: viewHeight)) 71 | return view 72 | } 73 | 74 | @objc func onGoButton() { 75 | colourDelegate?.didSelectColour(picker: self, colour: selectedColor) 76 | dismiss() 77 | } 78 | 79 | @objc func onSliderChanged() { 80 | // change the color 81 | selectedColor = UIColor(red: CGFloat(redSlider!.value), green: CGFloat(greenSlider!.value), blue: CGFloat(blueSlider!.value), alpha: 1.0) 82 | colourView?.backgroundColor = selectedColor 83 | } 84 | 85 | func createSlider(_ text: String, view: UIView) -> UISlider { 86 | let margin: CGFloat = 10 87 | 88 | let label = UILabel(frame: CGRect(x: margin, y: viewHeight, width: 0, height: 0)) 89 | label.text = text 90 | label.sizeToFit() 91 | view.addSubview(label) 92 | viewHeight += label.frame.size.height + margin/2 93 | 94 | let slider = UISlider(frame: CGRect(x: margin, y: viewHeight, width: view.frame.size.width-margin*2, height: 24)) 95 | slider.maximumValue = 1 96 | slider.minimumValue = 0 97 | slider.addTarget(self, action: #selector(onSliderChanged), for: .valueChanged) 98 | view.addSubview(slider) 99 | viewHeight += slider.frame.size.height + margin 100 | return slider 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /Tools/msgs/sensor_msgs/BatteryStateMessage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BatteryStateMessage.swift 3 | // 4 | // Created by wesgoodhoofd on 2019-01-22. 5 | // 6 | 7 | import UIKit 8 | import ObjectMapper 9 | 10 | public class BatteryStateMessage: RBSMessage { 11 | public var POWER_SUPPLY_STATUS_UNKNOWN: uint8 = 0 12 | public var POWER_SUPPLY_STATUS_CHARGING: uint8 = 0 13 | public var POWER_SUPPLY_STATUS_DISCHARGING: uint8 = 0 14 | public var POWER_SUPPLY_STATUS_NOT_CHARGING: uint8 = 0 15 | public var POWER_SUPPLY_STATUS_FULL: uint8 = 0 16 | public var POWER_SUPPLY_HEALTH_UNKNOWN: uint8 = 0 17 | public var POWER_SUPPLY_HEALTH_GOOD: uint8 = 0 18 | public var POWER_SUPPLY_HEALTH_OVERHEAT: uint8 = 0 19 | public var POWER_SUPPLY_HEALTH_DEAD: uint8 = 0 20 | public var POWER_SUPPLY_HEALTH_OVERVOLTAGE: uint8 = 0 21 | public var POWER_SUPPLY_HEALTH_UNSPEC_FAILURE: uint8 = 0 22 | public var POWER_SUPPLY_HEALTH_COLD: uint8 = 0 23 | public var POWER_SUPPLY_HEALTH_WATCHDOG_TIMER_EXPIRE: uint8 = 0 24 | public var POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE: uint8 = 0 25 | public var POWER_SUPPLY_TECHNOLOGY_UNKNOWN: uint8 = 0 26 | public var POWER_SUPPLY_TECHNOLOGY_NIMH: uint8 = 0 27 | public var POWER_SUPPLY_TECHNOLOGY_LION: uint8 = 0 28 | public var POWER_SUPPLY_TECHNOLOGY_LIPO: uint8 = 0 29 | public var POWER_SUPPLY_TECHNOLOGY_LIFE: uint8 = 0 30 | public var POWER_SUPPLY_TECHNOLOGY_NICD: uint8 = 0 31 | public var POWER_SUPPLY_TECHNOLOGY_LIMN: uint8 = 0 32 | public var header: HeaderMessage? 33 | public var voltage: float32 = 0 34 | public var current: float32 = 0 35 | public var charge: float32 = 0 36 | public var capacity: float32 = 0 37 | public var design_capacity: float32 = 0 38 | public var percentage: float32 = 0 39 | public var power_supply_status: uint8 = 0 40 | public var power_supply_health: uint8 = 0 41 | public var power_supply_technology: uint8 = 0 42 | public var present: bool = false 43 | public var cell_voltage: float32[] = [float32[]]() 44 | public var If: # 45 | public var location: string 46 | public var serial_number: string 47 | 48 | public override init() { 49 | super.init() 50 | header = HeaderMessage() 51 | } 52 | public required init?(map: Map) { 53 | super.init(map: map) 54 | } 55 | 56 | public override func mapping(map: Map) { 57 | POWER_SUPPLY_STATUS_UNKNOWN <- map["POWER_SUPPLY_STATUS_UNKNOWN"] 58 | POWER_SUPPLY_STATUS_CHARGING <- map["POWER_SUPPLY_STATUS_CHARGING"] 59 | POWER_SUPPLY_STATUS_DISCHARGING <- map["POWER_SUPPLY_STATUS_DISCHARGING"] 60 | POWER_SUPPLY_STATUS_NOT_CHARGING <- map["POWER_SUPPLY_STATUS_NOT_CHARGING"] 61 | POWER_SUPPLY_STATUS_FULL <- map["POWER_SUPPLY_STATUS_FULL"] 62 | POWER_SUPPLY_HEALTH_UNKNOWN <- map["POWER_SUPPLY_HEALTH_UNKNOWN"] 63 | POWER_SUPPLY_HEALTH_GOOD <- map["POWER_SUPPLY_HEALTH_GOOD"] 64 | POWER_SUPPLY_HEALTH_OVERHEAT <- map["POWER_SUPPLY_HEALTH_OVERHEAT"] 65 | POWER_SUPPLY_HEALTH_DEAD <- map["POWER_SUPPLY_HEALTH_DEAD"] 66 | POWER_SUPPLY_HEALTH_OVERVOLTAGE <- map["POWER_SUPPLY_HEALTH_OVERVOLTAGE"] 67 | POWER_SUPPLY_HEALTH_UNSPEC_FAILURE <- map["POWER_SUPPLY_HEALTH_UNSPEC_FAILURE"] 68 | POWER_SUPPLY_HEALTH_COLD <- map["POWER_SUPPLY_HEALTH_COLD"] 69 | POWER_SUPPLY_HEALTH_WATCHDOG_TIMER_EXPIRE <- map["POWER_SUPPLY_HEALTH_WATCHDOG_TIMER_EXPIRE"] 70 | POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE <- map["POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE"] 71 | POWER_SUPPLY_TECHNOLOGY_UNKNOWN <- map["POWER_SUPPLY_TECHNOLOGY_UNKNOWN"] 72 | POWER_SUPPLY_TECHNOLOGY_NIMH <- map["POWER_SUPPLY_TECHNOLOGY_NIMH"] 73 | POWER_SUPPLY_TECHNOLOGY_LION <- map["POWER_SUPPLY_TECHNOLOGY_LION"] 74 | POWER_SUPPLY_TECHNOLOGY_LIPO <- map["POWER_SUPPLY_TECHNOLOGY_LIPO"] 75 | POWER_SUPPLY_TECHNOLOGY_LIFE <- map["POWER_SUPPLY_TECHNOLOGY_LIFE"] 76 | POWER_SUPPLY_TECHNOLOGY_NICD <- map["POWER_SUPPLY_TECHNOLOGY_NICD"] 77 | POWER_SUPPLY_TECHNOLOGY_LIMN <- map["POWER_SUPPLY_TECHNOLOGY_LIMN"] 78 | header <- map["header"] 79 | voltage <- map["voltage"] 80 | current <- map["current"] 81 | charge <- map["charge"] 82 | capacity <- map["capacity"] 83 | design_capacity <- map["design_capacity"] 84 | percentage <- map["percentage"] 85 | power_supply_status <- map["power_supply_status"] 86 | power_supply_health <- map["power_supply_health"] 87 | power_supply_technology <- map["power_supply_technology"] 88 | present <- map["present"] 89 | cell_voltage <- map["cell_voltage"] 90 | If <- map["If"] 91 | location <- map["location"] 92 | serial_number <- map["serial_number"] 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /Tools/sync_messages.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | ##### 4 | # 5 | # Written by Wes Goodhoofd -- w@wesg.ca 6 | # Date January 21, 2019 7 | # 8 | # A tool to sync the message list from the ROS website 9 | # 10 | ##### 11 | 12 | import argparse 13 | import datetime 14 | import getpass 15 | import custom_messages 16 | import requests 17 | from bs4 import BeautifulSoup 18 | import urlparse, os 19 | import re 20 | 21 | typeMap = { 22 | 'float32' : 'Float32', 23 | 'float8' : 'Float8', 24 | 'float16' : 'Float16', 25 | 'string' : 'String', 26 | 'int8' : 'Int8' 27 | } 28 | 29 | def saveMessageFile(messageName, messageProperties, package, args): 30 | # generate the Swift message file 31 | msgFolder = os.path.realpath(args.folder) 32 | 33 | # determine if the package folder exists 34 | packageFolder = os.path.join(msgFolder, package) 35 | if not os.path.exists(packageFolder): 36 | os.makedirs(packageFolder) 37 | 38 | # generate the file 39 | messageFile = os.path.join(packageFolder, "%s.swift" % messageName) 40 | if not os.path.exists(messageFile) or args.force: 41 | # create the new file and overwrite the existing one 42 | custom_messages.createMessageFile(messageFile, messageName, messageProperties) 43 | 44 | if __name__ == '__main__': 45 | # process parameters 46 | parser = argparse.ArgumentParser(description='Sync messages from the ROS website') 47 | parser.add_argument("folder") 48 | parser.add_argument("--branch", "-b", action="store", default="jade-devel") 49 | parser.add_argument("--force", "-f", dest="force", action='store_true', default=False) 50 | parser.add_argument("--list", "-l", dest="page_list", action="store", default=None) 51 | parser.add_argument("--package", "-p", dest="package", action="store", default=None) 52 | args = parser.parse_args() 53 | 54 | # get a list of categories to download 55 | mainUrl = "https://github.com/ros/common_msgs/tree/%s/%s/msg" 56 | knownPackages = ["actionlib_msgs", "diagnostic_msgs", "geometry_msgs", "nav_msgs", "sensor_msgs", "shape_msgs", "stereo_msgs", "trajectory_msgs", "visualization_msgs"] 57 | types = [] 58 | repo = "common_msgs" 59 | 60 | # generate the array of packages 61 | if args.package is not None and args.page_list is not None: 62 | packages = [(args.page_list, args.package)] 63 | repo = args.package 64 | else: 65 | packages = [] 66 | for package in knownPackages: 67 | url = mainUrl % (args.branch, package) 68 | packages.append((url, package)) 69 | 70 | # download the page 71 | for (url,package) in packages: 72 | print "Processing package %s" % package 73 | 74 | r = requests.get(url) 75 | if r.status_code == 200: 76 | pageText = r.text 77 | soup = BeautifulSoup(pageText, 'lxml') 78 | 79 | # find the links to the messages 80 | links = soup.find('table', {"class" : "files"}).find('tbody').findAll('a', {'class' : 'js-navigation-open'}) 81 | 82 | msgLink = "https://raw.githubusercontent.com/ros/%s/%s/%s/msg/%s.msg" 83 | 84 | for link in links: 85 | messageLinkText = link.text 86 | href = link.attrs['href'] 87 | messageSearch = re.search("(.*)\.msg", messageLinkText) 88 | 89 | if messageSearch is not None: 90 | message = messageSearch.group(1) 91 | else: 92 | continue 93 | 94 | msgUrl = msgLink % (repo, args.branch, package, message) 95 | 96 | # do some hard coding if requesting the common msg repo 97 | msgUrl = msgUrl.replace('/std_msgs/msg/', '/msg/') 98 | 99 | # now download the page to parse the actual properties 100 | print "Processing message %s" % message 101 | 102 | msgR = requests.get(msgUrl) 103 | if msgR.status_code == 200: 104 | msgText = msgR.text 105 | msgComponents = msgText.split("\n") 106 | 107 | # go through each item 108 | filtered = [i for i in msgComponents if i and not i.startswith("#")] 109 | 110 | # split into type and name 111 | messageProperties = [] 112 | for messageProperty in filtered: 113 | componentSearch = re.search("([^\s]+)\s+([^\s]+)", messageProperty) 114 | if componentSearch: 115 | propertyName = componentSearch.group(2) 116 | propertyType = componentSearch.group(1) 117 | 118 | # check if it's a message 119 | typeComponents = propertyType.split('/') 120 | if len(typeComponents) == 2: 121 | propertyType = typeComponents[1] 122 | 123 | if propertyType[0].isupper(): 124 | if re.search('\[\]$', propertyType): 125 | propertyType = propertyType.replace('[]', 'Message[]') 126 | else: 127 | propertyType += "Message" 128 | 129 | property = [propertyName, propertyType] 130 | messageProperties.append(property) 131 | 132 | if propertyType not in types: 133 | types.append(propertyType) 134 | 135 | # generate a file 136 | saveMessageFile(message+"Message", messageProperties, package, args) 137 | else: 138 | print "Page %s -- status code %d" % (msgUrl, msgR.status_code) 139 | else: 140 | print "Page %s -- status code %d" % (url, r.status_code) 141 | 142 | types.sort() 143 | print types -------------------------------------------------------------------------------- /Example/RBSManager.xcodeproj/xcshareddata/xcschemes/RBSManager-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 67 | 68 | 78 | 80 | 86 | 87 | 88 | 89 | 93 | 94 | 95 | 96 | 97 | 98 | 104 | 106 | 112 | 113 | 114 | 115 | 117 | 118 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /Example/RBSManager/ModalContainerView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ModalContainerView.swift 3 | // Logger 4 | // 5 | // Created by Wes Goodhoofd on 2017-10-29. 6 | // Copyright © 2017 Wes Goodhoofd. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | protocol ModalViewDelegate { 12 | func modalViewDidClose(_ modal: ModalContainerView) 13 | } 14 | 15 | class ModalContainerView: UIView { 16 | var backgroundView: UIView? 17 | var parentWindow: UIWindow? 18 | var containerView: UIView? 19 | var mainView: UIView? 20 | var viewDelegate: ModalViewDelegate? 21 | static let greenColour = UIColor(red:0.19, green:0.63, blue:0.12, alpha:1.0) 22 | 23 | convenience init() { 24 | let window = UIApplication.shared.keyWindow! 25 | self.init(frame: window.bounds) 26 | self.parentWindow = window 27 | self.isHidden = true 28 | } 29 | 30 | func buildView() { 31 | // background black view 32 | backgroundView = UIView(frame: self.bounds) 33 | backgroundView?.backgroundColor = UIColor(white: 0, alpha: 0.8) 34 | self.addSubview(backgroundView!) 35 | 36 | // dismiss when tapped 37 | let gesture = UITapGestureRecognizer(target: self, action: #selector(dismiss)) 38 | backgroundView?.addGestureRecognizer(gesture) 39 | 40 | // build the container view 41 | let margin:CGFloat = 10 42 | var containerFrame = CGRect(x: 0, y: 0, width: self.frame.size.width-2*margin, height: margin) 43 | self.containerView = UIView(frame: containerFrame) 44 | self.containerView?.backgroundColor = UIColor.white 45 | let buttonMaxHeight: CGFloat = 40 46 | var minSpace: CGFloat = margin * 6 + buttonMaxHeight 47 | 48 | if let titleString = getTitle() { 49 | let titleLabel = UILabel(frame: CGRect(x: margin, y: containerFrame.size.height, width: 0, height: 0)) 50 | titleLabel.text = titleString 51 | titleLabel.font = UIFont.boldSystemFont(ofSize: 20) 52 | titleLabel.textColor = UIColor.black 53 | titleLabel.sizeToFit() 54 | self.containerView?.addSubview(titleLabel) 55 | containerFrame.size.height += titleLabel.frame.size.height+margin 56 | minSpace += titleLabel.frame.size.height + margin*2 57 | } 58 | 59 | self.mainView = getMainView(CGSize(width: containerFrame.size.width - 2*margin, height: self.frame.size.height - minSpace)) 60 | if self.mainView != nil { 61 | let space: CGFloat = min(margin, (containerFrame.size.width - self.mainView!.frame.size.width) / 2.0) 62 | self.mainView!.frame = CGRect(x: space, y: containerFrame.size.height, width: self.mainView!.frame.size.width, height: self.mainView!.frame.size.height) 63 | containerFrame.size.width = self.mainView!.frame.size.width + 2*space 64 | containerFrame.size.height += self.mainView!.frame.size.height+space 65 | containerView!.addSubview(self.mainView!) 66 | } 67 | 68 | // add buttons 69 | var buttonHeight: CGFloat = 0 70 | if let leftButton = getLeftButton() { 71 | leftButton.frame = CGRect(x: margin, y: containerFrame.size.height, width: leftButton.frame.size.width, height: min(buttonMaxHeight, leftButton.frame.size.height)) 72 | self.containerView?.addSubview(leftButton) 73 | buttonHeight = leftButton.frame.size.height 74 | } 75 | 76 | if let rightButton = getRightButton() { 77 | rightButton.frame = CGRect(x: containerFrame.size.width - margin - rightButton.frame.size.width, y: containerFrame.size.height, width: rightButton.frame.size.width, height: min(buttonMaxHeight, rightButton.frame.size.height)) 78 | self.containerView?.addSubview(rightButton) 79 | buttonHeight = max(buttonHeight, rightButton.frame.size.height) 80 | } 81 | 82 | minSpace += buttonHeight 83 | containerFrame.size.height += buttonHeight + margin 84 | self.containerView?.frame = containerFrame 85 | self.containerView?.center = CGPoint(x: self.frame.size.width/2, y: self.frame.size.height/2) 86 | self.addSubview(self.containerView!) 87 | 88 | self.parentWindow?.addSubview(self) 89 | } 90 | 91 | @objc func dismiss() { 92 | UIView.animate(withDuration: 0.25, animations: { 93 | self.alpha = 0.0 94 | }) { (complete) in 95 | self.isHidden = true 96 | self.viewDelegate?.modalViewDidClose(self) 97 | } 98 | } 99 | 100 | func show() { 101 | self.buildView() 102 | self.setNeedsLayout() 103 | self.willShow() 104 | self.alpha = 0 105 | self.isHidden = false 106 | 107 | UIView.animate(withDuration: 0.25) { 108 | self.alpha = 1.0 109 | } 110 | } 111 | 112 | // overridden methods 113 | func getMainView(_ availableSize: CGSize) -> UIView? { 114 | return nil 115 | } 116 | 117 | func willShow() { 118 | 119 | } 120 | 121 | func getTitle() -> String? { 122 | return "Modal view" 123 | } 124 | 125 | func getLeftButton() -> UIButton? { 126 | return nil 127 | } 128 | 129 | func getRightButton() -> UIButton? { 130 | let dismissButton = createBottomButton(title: NSLocalizedString("dismiss", comment: "dismiss button"), color: ModalContainerView.greenColour) 131 | dismissButton.addTarget(self, action: #selector(dismiss), for: .touchUpInside) 132 | return dismissButton 133 | } 134 | 135 | func createBottomButton(title: String, color: UIColor) -> UIButton { 136 | let button = UIButton(type: .custom) 137 | button.frame = CGRect(x: 0, y: 0, width: 0, height: 40) 138 | button.setTitle(title, for: .normal) 139 | button.backgroundColor = color 140 | button.setTitleColor(UIColor.white, for: .normal) 141 | button.titleLabel?.font = UIFont.boldSystemFont(ofSize: 17) 142 | button.sizeToFit() 143 | button.frame = CGRect(x: 0, y: 0, width: button.frame.size.width + 20, height: button.frame.size.height) 144 | return button 145 | } 146 | } 147 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # RBSManager 2 | 3 | [![Version](https://img.shields.io/cocoapods/v/RBSManager.svg?style=flat)](http://cocoapods.org/pods/RBSManager) 4 | [![License](https://img.shields.io/cocoapods/l/RBSManager.svg?style=flat)](http://cocoapods.org/pods/RBSManager) 5 | [![Platform](https://img.shields.io/cocoapods/p/RBSManager.svg?style=flat)](http://cocoapods.org/pods/RBSManager) 6 | 7 | A Swift-native library for handling the WebSocket connection to a [Robot Operating System](http://www.ros.org) (ROS) master running ROSBridge. Control your robots with a mobile phone. 8 | 9 | It is largely a drop-in replacement to my earlier Objective-C library, [RBManager](https://github.com/wesgood/RBManager). *Fun fact, the extra S stands for Swift.* 10 | 11 | RBSManager provides a wrapper for the different ROS functionality calls: 12 | 13 | * [Subscribers](#subscribers) 14 | * [Publishers](#publishers) 15 | * [Service Calls](#service-calls) 16 | 17 | ## Dependencies 18 | RBSManager uses the following Github components, installed with the CocoaPod: 19 | 20 | * [Starscream](https://github.com/daltoniam/starscream) -- a Swift native Websocket library 21 | * [ObjectMapper](https://github.com/Hearst-DD/ObjectMapper) -- a tool to translate JSON data into Swift objects (used by the ROS message system) 22 | 23 | Thank you to their developers! 24 | 25 | ### Acknowledgements ### 26 | Additionally here are some of the users that have contributed code or message definitions. Thank you to them too! 27 | 28 | * [Brandon M](https://github.com/BrandonMan123/MRG-Racecar-App) 29 | 30 | ## Example 31 | 32 | To run the example project, clone the repo, and run `pod install` from the Example directory first. The example project connects to the Turtlesim node and provides the following operations: 33 | * demonstrate a subscriber to display X, Y and Theta state of the turtle 34 | * rotate a turtle icon to show how the theta value changes 35 | * control a turtle using left, right, up, down buttons to demonstrate publishing a message 36 | * reset the turtlesim using a service call demonstration 37 | * accept dynamic host values 38 | * configure the background using a custom modal colour picker and set parameter service calls 39 | * teleport a turtle with an alert view and service calls using a message object 40 | * click multiple directions simultaneously (easier on a device) to properly steer the turtle around 41 | 42 | ## Requirements 43 | 44 | * iOS 10+ 45 | * Swift 3+ 46 | * ROS master running a [ROSBridge server](http://wiki.ros.org/rosbridge_suite) 47 | * A valid Apple developer account if you want to test on an actual device 48 | 49 | ## Installation 50 | 51 | RBSManager is available through [CocoaPods](http://cocoapods.org). To install 52 | it, simply add the following line to your Podfile: 53 | 54 | ```ruby 55 | pod 'RBSManager' 56 | ``` 57 | 58 | ## Usage 59 | 60 | As mentioned the library itself behaves very similar to RBManager. It contains a singleton object so that only instance of the manager is needed -- `RBSManager.sharedManager()` 61 | 62 | ### Delegate 63 | The manager will post events to the following methods at various points: 64 | ``` 65 | func manager(_ manager: RBSManager, didDisconnect error: Error?) 66 | func managerDidConnect(_ manager: RBSManager) 67 | func manager(_ manager: RBSManager, threwError error: Error) 68 | ``` 69 | The error objects will either be forwarded from the socket itself or be related to manager functionality. The error description will include info about what went wrong. 70 | 71 | All delegate calls are done on the main UI thread. Processing and JSON handling are done on a background thread to avoid locking the interface. 72 | 73 | ### Messages 74 | Messages are the core ROS component and RBSManager implements the `Mappable` protocol to handle them. There are currently a small number of messages included in the library and more will be added in the future (I had to select which ones I felt were most important). Custom messages can be added as long as they inherit from `RBSMessage` and properly follow the `Mappable` protocol. 75 | 76 | Messages should generally have foundation object types like Float64 and String but can also handle nested RBSMessage types. The catch is that nested objects need additional setup to handle the init methods in place. View the `TwistMessage` type to see how that works. 77 | 78 | The way that Swift works meant some compromises with the overall message system (mostly relating to object types and casting) so I hope to review it and improve over time. 79 | 80 | ### Subscribers 81 | Create a new subscriber by calling the following method on the manager: 82 | ``` 83 | func addSubscriber(topic: String, messageClass: RBSMessage.Type, response: @escaping ((_ message: RBSMessage) -> (Void))) -> RBSSubscriber 84 | ``` 85 | * topic -- the ROS node to subscribe to 86 | * messageClass -- the type declaration of the message to receive (eg. use `TwistMessage.self`) 87 | * response -- a callback to receive the message 88 | 89 | Example: 90 | ``` 91 | let turtleSubscriber = turtleManager?.addSubscriber(topic: "/turtle1/pose", messageClass: PoseMessage.self, response: { (message) -> (Void) in 92 | // update the view with message data 93 | self.updateWithMessage(message as! PoseMessage) 94 | }) 95 | ``` 96 | As a change from the delegate pattern of `RBManager` , the callback structure maintains a more Swift-like process and better allows multiple subscribers on the same topic. The subscriber object also exposes most options available to ROS, like queue length and throttle rate. 97 | 98 | A subscriber will auto subscribe when the manager connects but you can connect/disconnect manually by calling `.subscribe()` or `.unsubscribe()` respectively. 99 | 100 | ### Publishers 101 | Create a new publisher by calling the following method on the manager: 102 | ``` 103 | func addPublisher(topic: String, messageType: String, messageClass: RBSMessage.Type) -> RBSPublisher 104 | ``` 105 | * topic -- the ROS node to publish to 106 | * messageType -- the type of message ROS is expecting (eg. `geometry_msgs/Twist`) 107 | * messageClass -- the class type that you will be sending (eg. `TwistMessage.self`) 108 | 109 | Example 110 | ``` 111 | let turtlePublisher = turtleManager?.addPublisher(topic: "/turtle1/cmd_vel", messageType: "geometry_msgs/Twist", messageClass: TwistMessage.self) 112 | ``` 113 | 114 | Create a new message object separately and publish it by passing the message object to `.publish(_ message: RBSMessage)` 115 | 116 | A publisher is advertised when the manager connects but you can manually change it's state by calling `.advertise()` or `.unadvertise()` 117 | 118 | ### Service calls 119 | Service calls are made to perform an operation on ROS, with or without parameters and a response value. Create a new service call by using the following method on the manager: 120 | ``` 121 | func makeServiceCall(service: String) -> RBSServiceCall 122 | ``` 123 | * service -- the ROS topic/node to make the request with 124 | 125 | Example 126 | ``` 127 | let serviceCall = turtleManager?.makeServiceCall(service: "/reset") 128 | ``` 129 | The service call can be triggered by calling `.send(_ response: ((_ response: RBSResponse) -> (Void))?)`. That optional response callback can receive the service call response and return an `RBSResponse` of data. 130 | 131 | Version 0.4 moves to the `RBSResponse` data type, which includes additional context about the request. Use `response.values` to look for the data returned by the call. 132 | 133 | Example 134 | ``` 135 | serviceCall?.send({ (response) -> (Void) in 136 | if let values = response.values as? [String:Any], let value = values["value"] as? String { 137 | self.number = Float64(value) 138 | } 139 | }) 140 | ``` 141 | 142 | To pass data to the service call itself, assign data to one of: dataArgument (dictionary), messageArgument (an RBSMessage object) or arrayArgument (array) 143 | 144 | ### Parameters 145 | The manager can also handle setting and getting ROS parameters by generating a service call object with preformatted properties. 146 | ``` 147 | func getParam(name: String) -> RBSServiceCall 148 | func setParam(name: String, value: Any) -> RBSServiceCall 149 | ``` 150 | Use the regular send callback to receive data. 151 | 152 | ## Design considerations 153 | ### Multiple subscribers 154 | While building a custom robot controller, I investigated the best way to subscribe to the same topic multiple times. While subscribers allow IDs to be assigned, the return values do not respect these. In practice this means that if two subscribers have different refresh rates, they will both receive the message at the fastest rate specified. 155 | 156 | To get around this it is recommended that you use the iOS notification pattern to distribute messages based on your requirements. A single DataModel type object can subscribe to each unique topic and share the messages with the individual controllers. 157 | 158 | ## Tools 159 | ### Custom message generator 160 | As a convenience, I've included a Python script to generate Swift message files. It isn't perfect, but will do most of the work necessary for the messages to compile. It is located in the Tools folder. 161 | 162 | ``` 163 | python ./custom_messages.py [class name] [variables...n] 164 | ``` 165 | 166 | where 167 | 168 | * [class name] = the name of the file/class (should include Message for consistency) 169 | * [variables...n] = variable name and Swift type, separated by colon 170 | 171 | Example: 172 | ``` 173 | python ./custom_messages.py ExampleMessage stringData:String floatData:Float intData:Int 174 | ``` 175 | 176 | 177 | ## Roadmap 178 | This library changes a lot of things from my previous work and will definitely be in progress for some time. Please take that caveat into account when building a project and reach out to me if there is a feature you think the library is missing. 179 | 180 | * populate all standard ROS message types 181 | * convert all Dictionary based parameter handling to custom objects using JSON mapping 182 | 183 | ### Actionlib ### 184 | The rosbridge project does not mention any support for the actionlib components. The protocol is listed [here](https://github.com/RobotWebTools/rosbridge_suite/blob/groovy-devel/ROSBRIDGE_PROTOCOL.md). If this is functionality you're looking for, I suggest connecting with that team. 185 | 186 | ## Author 187 | 188 | wesgood, w [at] wesg [dot] ca, @wesgood 189 | 190 | *Mobile software developer, mechatronics engineer, robot enthusiast.* 191 | 192 | ## License 193 | 194 | RBSManager is available under the MIT license. See the LICENSE file for more info. 195 | 196 | TL;DR; Please do lots of cool things with my library, but share them with me so I can see what it's being used for. Even better, include a link or acknowledgement of the library in your project. 197 | --------------------------------------------------------------------------------