Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Martin Heyden
LabProcesses.jl
Commits
0047c953
Commit
0047c953
authored
Aug 21, 2017
by
Fredrik Bagge Carlson
Browse files
Start implement b&b simulator
parent
7b300cda
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/interface_implementations/ballandbeam.jl
View file @
0047c953
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment