Skip to content
This repository has been archived by the owner on Aug 4, 2024. It is now read-only.

Replace ros #15

Draft
wants to merge 76 commits into
base: devel
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
c295d74
B button now sets current robot orientation as 0 degrees
emielsteerneman Aug 12, 2018
eb65c10
Changed to driving relative to robot orientation
emielsteerneman Aug 12, 2018
f7bc7c6
Added absolute and relative controls with Y+Back
RobZelluf Aug 15, 2018
bdd40f6
Fixed fifa mode for joystick input
RobZelluf Aug 28, 2018
2c3acaf
delete unused (all) input controller tests
mrlukasbos Aug 28, 2018
21ae51c
extract large graphics part to seperate class
mrlukasbos Aug 28, 2018
fc96883
make it possible to run rtt_make again
mrlukasbos Sep 4, 2018
ef0177d
use sdl2 TTF as extra dependency to use text in the interface
mrlukasbos Sep 4, 2018
ac0335b
created some util functions
mrlukasbos Sep 4, 2018
d82b28b
start with using fonts
mrlukasbos Sep 4, 2018
ace780b
Fix styling problems for inputInterface
mrlukasbos Sep 4, 2018
2097e03
Refactor src/input_interface.cpp
mrlukasbos Sep 5, 2018
4d88653
Refactoring major parts (currently breaks)
mrlukasbos Sep 5, 2018
8cc7ce0
Fix all compilation errors. Still a lot of runtime bugs present.
mrlukasbos Sep 6, 2018
9a28583
Fix some key problems, driving the robot around works again.
mrlukasbos Sep 6, 2018
497bb00
Fix id switching
mrlukasbos Sep 6, 2018
0f82d7e
Add "man" command for cmd line
mrlukasbos Sep 6, 2018
d92ea34
Fix rotation in keyboardcontroller
mrlukasbos Sep 6, 2018
9b8f814
Fix some control bugs for rotation
mrlukasbos Sep 6, 2018
53c3072
Change the launcher to work with the new controller AND Update GUI
Sep 7, 2018
ea5aac7
Update .gitignore for Clion python environment
Sep 7, 2018
f75c2ae
Remove rtt namespace and autoplay
RobZelluf Sep 14, 2018
bddc80c
Add children joystick profile
RobZelluf Sep 16, 2018
9873d64
Merge pull request #9 from RoboTeamTwente/feature/joystick_controller…
Sep 17, 2018
668dbed
keyboard improvements
mrlukasbos Sep 17, 2018
66d7648
Revert "delete unused (all) input controller tests"
mrlukasbos Sep 17, 2018
9255a64
Add some tests for the keyboardManager (and already fixed a bug with it)
mrlukasbos Sep 17, 2018
242cd30
Add geneva, kicker and chipper test
mrlukasbos Sep 17, 2018
e3f03ff
Fix geneva test
mrlukasbos Sep 17, 2018
79ebd31
Add more structure to the tests
mrlukasbos Sep 18, 2018
bc072a1
add joystick Test
mrlukasbos Sep 18, 2018
0015e02
Does not work currently
RobZelluf Sep 18, 2018
2e07c09
Add constants file
mrlukasbos Sep 18, 2018
7a5ac30
Add more tests for keyboardManager
mrlukasbos Sep 18, 2018
fff8bb9
Improve structure of tests
mrlukasbos Sep 18, 2018
70d02df
Merge branch 'feature/refactor-input-controllers' into feature/refact…
mrlukasbos Sep 18, 2018
6b5c23a
Add fake joystickmsg
mrlukasbos Sep 18, 2018
1221dd1
Add minor code cleanup
mrlukasbos Sep 19, 2018
946e864
Add msg_prev to check if pressed before, not fully working yet
RobZelluf Sep 20, 2018
5028665
Kicker not working yet
RobZelluf Sep 20, 2018
3ca3ed6
Deleted joystick old
RobZelluf Sep 20, 2018
cad7684
Chipper not working yet
RobZelluf Sep 21, 2018
8640760
Fix chipper / Put geneva drive to X + DpadX
RobZelluf Sep 25, 2018
bf2c2c2
Remove press and isPressed variables
RobZelluf Sep 25, 2018
bc8a7ff
Create joystick_manager.cpp and joystick_manager.h
RobZelluf Sep 26, 2018
de5b3b7
Fix header problem
RobZelluf Sep 27, 2018
7bc89bd
Fix chipper // Set chipper velocity to 5
RobZelluf Sep 27, 2018
272d4ea
Remove commented out parts
RobZelluf Sep 27, 2018
826c40b
Merge remote-tracking branch 'origin' into feature/refactor-input-con…
mrlukasbos Sep 28, 2018
eaf7821
Merge pull request #8 from RoboTeamTwente/feature/refactor-input-cont…
mrlukasbos Sep 28, 2018
e7fc609
Remove horizontal comments // Rename setRobotID
RobZelluf Oct 1, 2018
f9302e7
Merge branch 'master' into feature/refactor-joystick-controller
RobZelluf Oct 1, 2018
caa5463
Merge pull request #10 from RoboTeamTwente/feature/refactor-joystick-…
Oct 15, 2018
a79219b
Removed 16's
Jan 25, 2019
10a4788
Divide rotation multiplier by 10
RobZelluf Feb 11, 2019
6b92f45
Divide rotationn multipliers by 10
RobZelluf Feb 14, 2019
1f05674
Merge branch 'feature/fixJoystick' of https://github.com/RoboTeamTwen…
RobZelluf Feb 14, 2019
0748709
Merge pull request #13 from RoboTeamTwente/feature/fixJoystick
mrlukasbos Feb 14, 2019
1e7cfcd
Cleanup. Started with JoystickManager (as good as finished)
emielsteerneman Oct 21, 2019
c7ac7d0
Added the joystick handler to the joystick manager. Checks input and …
luukklnv Oct 23, 2019
e498ba6
Added publisher and seperated JoystickHandler into smaller functions.…
luukklnv Oct 26, 2019
fbde56e
Added publisher and seperated JoystickHandler into smaller functions.…
luukklnv Oct 26, 2019
dec4f1c
Robot drives and shoots. Switching Id works
emielsteerneman Oct 27, 2019
78293d5
.
luukklnv Oct 28, 2019
5fe2164
Driving with robot now works in real life.
Oct 28, 2019
9156777
Added other commands
luukklnv Oct 28, 2019
c02c980
Moved code to functions
luukklnv Oct 28, 2019
7e7d5a0
fixed kicking
Oct 29, 2019
b0ca17a
Minor cleanliness changes
luukklnv Oct 31, 2019
f074c29
Made speed scaleable and changed some readability
Oct 31, 2019
9464a73
Added stopcondition
luukklnv Oct 31, 2019
5a0f83f
Made JoystickManager thread-safe
Nov 2, 2019
eb34145
Disabled logging message
Nov 2, 2019
7ec7a4a
Removed unused files. roboteam_input almost ready to be run via robot…
Nov 25, 2019
fea543d
added velocity to dribbler
rttwente Feb 14, 2020
6bfb888
Applied linter
rttwente Feb 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@

.idea/
cmake-build-debug/

# Python environment for Clion
venv/

# Mac OS files
.DS_Store
108 changes: 19 additions & 89 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,98 +1,28 @@
cmake_minimum_required(VERSION 2.8.3)
cmake_minimum_required(VERSION 3.10)
project(roboteam_input)

# Needed for the documentation generator.
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
roscpp
joy
std_msgs
sensor_msgs
roboteam_msgs # for message definition
roboteam_utils
# roboteam_tactics
)
find_package(SDL2 REQUIRED sdl2)
include_directories(${SDL2_INCLUDE_DIRS} ${SDL2IMAGE_INCLUDE_DIRS})

## Need to install:
# sudo apt-get install libsdl2-dev
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
find_package(SDL2)
include_directories(${SDL2_INCLUDE_DIR})


catkin_package(
# INCLUDE_DIRS include
# LIBRARIES roboteam_control
# CATKIN_DEPENDS roscpp std_msgs
# DEPENDS system_lib
CATKIN_DEPENDS
roscpp
std_msgs
sensor_msgs
message_runtime
roboteam_msgs
roboteam_utils
# roboteam_tactics
)

###########
## Build ##
###########

add_definitions(-std=c++11)

## Specify additional locations of header files
## Your package locations should be listed before other locations
# include_directories(include)
include_directories(
${catkin_INCLUDE_DIRS}
src
boost-process/include
)



add_executable(joystick_input src/joystick_input.cpp src/joystick_enums.h src/joystick_profiles.h)
target_link_libraries(joystick_input ${catkin_LIBRARIES})
add_dependencies(joystick_input ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

if (${SDL2_FOUND})

MESSAGE("-- Building keyboard controller with SDL2")

add_executable(keyboard_controller
src/keyboard_controller.cpp
set (JOYSTICK_SOURCES
src/joystick/JoystickHandler.cpp
src/joystick/JoystickManager.cpp
)
target_link_libraries( keyboard_controller
${catkin_LIBRARIES}
${SDL2_LIBRARY}
)
add_dependencies(keyboard_controller
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
)

else (${SDL2_FOUND})

MESSAGE("-- SDL2 not found, so cannot build keyboard_controller! Have you installed SDL2?")

endif(${SDL2_FOUND})


add_executable(joystick
${JOYSTICK_SOURCES}
)

target_include_directories(joystick
PRIVATE include/roboteam_input
)

#############
## Testing ##
#############

catkin_add_gtest(input_test
test/main.cpp
test/SimpleTest.cpp
)
target_link_libraries(input_test ${catkin_LIBRARIES})

target_link_libraries(joystick
${SDL2_LIBRARIES}
roboteam_proto
roboteam_utils
)

23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# roboteam\_input

## Getting the controllers right
Just plug them all in. Start the `joysticks.launch` file. Then assign the joysticks to the right players. Keep in mind that the xbox receiver creates 4 controllers, even though you might only connect 1 xbox controller.

## Testing which controller is which & if they are functioning properly.

`ls /dev/input/` should tell you which joysticks are available. They are typically numbered from js0 to js8 or some other N. With `jstest /dev/input/jsX` (where X = some integer between 0 and infinity) you can check if the joystick is working correctly, and also check which joystick is connected to that port.

## Installing SDL2 for keyboard controller

`sudo apt-get install libsdl2-dev` should take care of it. If you don't have it installed it should not give an error but just not compile the keyboard controller.
# RoboTeam Input
This repository allows manual control of robots.
At the moment, only input from xbox-360 controllers is supported.

#### Possible improvements
* Automatic braking when robots are about to crash
* Keyboard support
* Assisted driving
* Automatically enable / disable dribbler
* Automatically look at ball when needed
* Following path user obviously wants to follow
34 changes: 0 additions & 34 deletions boost-process/.gitignore

This file was deleted.

119 changes: 0 additions & 119 deletions boost-process/.travis.yml

This file was deleted.

24 changes: 0 additions & 24 deletions boost-process/README.md

This file was deleted.

1 change: 0 additions & 1 deletion boost-process/REMOVE_THIS_TO_ENABLE_GIT.git/HEAD

This file was deleted.

11 changes: 0 additions & 11 deletions boost-process/REMOVE_THIS_TO_ENABLE_GIT.git/config

This file was deleted.

1 change: 0 additions & 1 deletion boost-process/REMOVE_THIS_TO_ENABLE_GIT.git/description

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading