diff --git a/src/interface_implementations/ballandbeam.jl b/src/interface_implementations/ballandbeam.jl index 6e9a8fdbb65b2559855b164ebabd591ecbd491aa..e4a8a63fb0bd49a55efc1e21b776290d62b66290 100644 --- a/src/interface_implementations/ballandbeam.jl +++ b/src/interface_implementations/ballandbeam.jl @@ -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