Commit 0047c953 authored by Fredrik Bagge Carlson's avatar Fredrik Bagge Carlson
Browse files

Start implement b&b simulator

parent 7b300cda
......@@ -10,8 +10,9 @@ BallAndBeam() = BallAndBeam(0.01, 0.0)
struct BallAndBeamSimulator <: SimulatedProcess
h::Float64
state::Vector{Float64} # pos,vel,angle,ω
end
BallAndBeamSimulator() = BallAndBeamSimulator(0.01)
BallAndBeamSimulator() = BallAndBeamSimulator(0.01, zeros(4))
const BallAndBeamType = Union{BallAndBeam, BallAndBeamSimulator}
num_outputs(p::BallAndBeamType) = 2
......@@ -28,7 +29,7 @@ measure(p::BallAndBeam) = io2num(ccall((:comedi_read,comedipath), Int32,
(Int32,Int32,Int32), 0,0,0))
control(p::BallAndBeamSimulator, u) = error("Not yet implemented")
measure(p::BallAndBeamSimulator) = error("Not yet implemented")
measure(p::BallAndBeamSimulator) = [p.state[1], p.state[3]]
const comedipath = Pkg.dir("LabProcesses","c","comedi_bridge.so")
const conversion = 65535/20
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment