Skip to content

Instantly share code, notes, and snippets.

@KKostya
Last active July 25, 2018 14:27
Show Gist options
  • Save KKostya/fbd07c6da5d6a7de6c2adda597014840 to your computer and use it in GitHub Desktop.
Save KKostya/fbd07c6da5d6a7de6c2adda597014840 to your computer and use it in GitHub Desktop.
let make_twist_message v omega=
let open Geometry_msgs in
let mkvector x y z = { vector3_x = x; vector3_y = y; vector3_z = z } in
Twist { twist_linear = mkvector v 0 0 ; twist_angular = mkvector 0 0 omega }
let process_clock_message state =
match state.mode with
| Driving -> { state with outgoing = Some (make_twist_message 10000 0) }
| Turning -> begin
match state.direction with
| None
| Some ( CW ) -> { state with outgoing = Some (make_twist_message 0 10000) }
| Some (CCW ) -> { state with outgoing = Some (make_twist_message 0 (-10000))}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment