Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
crs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Marius Bock
crs
Commits
e86e1f66
Commit
e86e1f66
authored
Nov 15, 2018
by
CRS-User
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://fsstud.is.uni-due.de:8090/sfmabock/crs
parents
ace020cf
c264de6f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
7 deletions
+7
-7
include/er1driver/crsinputhelper.hpp
include/er1driver/crsinputhelper.hpp
+2
-2
src/er1_control_node/main.cpp
src/er1_control_node/main.cpp
+2
-2
src/er1_control_node_student/main.cpp
src/er1_control_node_student/main.cpp
+1
-1
src/er1driver/crsinputhelper.cpp
src/er1driver/crsinputhelper.cpp
+2
-2
No files found.
include/er1driver/crsinputhelper.hpp
View file @
e86e1f66
...
...
@@ -23,8 +23,8 @@ public:
*/
bool
init
();
Key
getKey
Down
();
bool
isKey
Up
();
Key
getKey
Pressed
();
bool
isKey
Released
();
void
checkKeys
();
private:
...
...
src/er1_control_node/main.cpp
View file @
e86e1f66
...
...
@@ -56,14 +56,14 @@ int main(int argc, char** argv) {
helper
.
checkKeys
();
// Stop the robot on any keyup
if
(
helper
.
isKey
Up
())
{
if
(
helper
.
isKey
Released
())
{
crs
::
ER1ControlMsg
msg
;
msg
.
er1command
=
crs
::
ER1ControlMsg
::
ER1CommandStop
;
publisher
.
publish
(
msg
);
}
// Send command if keydown
auto
key
=
helper
.
getKey
Down
();
auto
key
=
helper
.
getKey
Pressed
();
if
(
key
==
Key
::
None
)
{
}
else
if
(
key
==
Key
::
Left
)
{
...
...
src/er1_control_node_student/main.cpp
View file @
e86e1f66
...
...
@@ -57,7 +57,7 @@ int main(int argc, char** argv) {
helper
.
checkKeys
();
// Stop the robot on any keyup
if
(
helper
.
isKey
Up
())
{
if
(
helper
.
isKey
Released
())
{
crs
::
ER1ControlMsg
msg
;
msg
.
er1command
=
crs
::
ER1ControlMsg
::
ER1CommandStop
;
publisher
.
publish
(
msg
);
...
...
src/er1driver/crsinputhelper.cpp
View file @
e86e1f66
...
...
@@ -24,7 +24,7 @@ bool CRSInputHelper::init() {
}
Key
CRSInputHelper
::
getKey
Down
()
{
Key
CRSInputHelper
::
getKey
Pressed
()
{
if
(
hasNewKeyDown
)
{
hasNewKeyDown
=
false
;
return
static_cast
<
Key
>
(
currentDown
);
...
...
@@ -33,7 +33,7 @@ Key CRSInputHelper::getKeyDown() {
}
}
bool
CRSInputHelper
::
isKey
Up
()
{
bool
CRSInputHelper
::
isKey
Released
()
{
if
(
hasNewKeyUp
)
{
hasNewKeyUp
=
false
;
return
true
;
...
...
Write
Preview
Markdown
is supported
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