Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Skyward Boardcore
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Avionics
Software Development
Skyward Boardcore
Commits
2cfd7aa5
Commit
2cfd7aa5
authored
1 year ago
by
Emilio Corigliano
Committed by
Matteo Pignataro
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
[Stepper] Updated StepperData struct
parent
082ab1f4
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!177
[Stepper] Updated StepperData struct
Pipeline
#6256
passed
1 year ago
Stage: build
Stage: test
Stage: lint
Stage: documentation
Stage: deploy
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/shared/actuators/stepper/Stepper.cpp
+2
-7
2 additions, 7 deletions
src/shared/actuators/stepper/Stepper.cpp
src/shared/actuators/stepper/StepperData.h
+15
-7
15 additions, 7 deletions
src/shared/actuators/stepper/StepperData.h
with
17 additions
and
14 deletions
src/shared/actuators/stepper/Stepper.cpp
+
2
−
7
View file @
2cfd7aa5
...
@@ -166,13 +166,8 @@ bool Stepper::isEnabled() { return enabled; }
...
@@ -166,13 +166,8 @@ bool Stepper::isEnabled() { return enabled; }
StepperData
Stepper
::
getState
(
float
moveDeg
)
StepperData
Stepper
::
getState
(
float
moveDeg
)
{
{
return
{
TimestampTimer
::
getTimestamp
(),
return
{
TimestampTimer
::
getTimestamp
(),
enabled
,
getCurrentDegPosition
(),
static_cast
<
unsigned
int
>
(
stepPin
.
getPort
()),
speed
,
moveDeg
};
stepPin
.
getNumber
(),
enabled
,
getCurrentDegPosition
(),
speed
,
moveDeg
};
}
}
}
// namespace Boardcore
}
// namespace Boardcore
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/shared/actuators/stepper/StepperData.h
+
15
−
7
View file @
2cfd7aa5
...
@@ -30,24 +30,32 @@ namespace Boardcore
...
@@ -30,24 +30,32 @@ namespace Boardcore
struct
StepperData
struct
StepperData
{
{
uint64_t
timestamp
;
uint64_t
timestamp
;
unsigned
int
pulsePinPort
;
unsigned
int
pulsePinNumber
;
bool
enabled
;
bool
enabled
;
float
positionDeg
;
float
positionDeg
;
float
speed
;
float
speed
;
float
moveDeg
;
float
moveDeg
;
StepperData
()
:
timestamp
(
0
),
enabled
(
0
),
positionDeg
(
0
),
speed
(
0
),
moveDeg
(
0
)
{
}
StepperData
(
uint64_t
timestamp
,
bool
enabled
,
float
positionDeg
,
float
speed
,
float
moveDeg
)
:
timestamp
(
timestamp
),
enabled
(
enabled
),
positionDeg
(
positionDeg
),
speed
(
speed
),
moveDeg
(
moveDeg
)
{
}
static
std
::
string
header
()
static
std
::
string
header
()
{
{
return
"timestamp,pulsePinPort,pulsePinNumber,enabled,positionDeg,"
return
"timestamp,enabled,positionDeg,speed,moveDeg
\n
"
;
"speed,moveDeg
\n
"
;
}
}
void
print
(
std
::
ostream
&
os
)
const
void
print
(
std
::
ostream
&
os
)
const
{
{
os
<<
timestamp
<<
","
<<
pulsePinPort
<<
","
<<
pulsePinNumber
<<
","
os
<<
timestamp
<<
","
<<
enabled
<<
","
<<
positionDeg
<<
","
<<
speed
<<
enabled
<<
","
<<
positionDeg
<<
","
<<
speed
<<
","
<<
moveDeg
<<
","
<<
moveDeg
<<
"
\n
"
;
<<
"
\n
"
;
}
}
};
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment