Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arm Firmware Master PR #431

Open
wants to merge 124 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
3c1d9ee
Initialized arm driver node
ihsan314 Jun 26, 2022
d65d4de
initialize teensy based code
ihsan314 Jun 26, 2022
038c531
Add xbox-switch switching logic and complete initialization of teensy
ihsan314 Jun 26, 2022
c95f8b5
Add mode to procontroller_snowbots package
ihsan314 Jun 26, 2022
e88ca50
Remove starter code
ihsan314 Jun 26, 2022
0ce27e3
fix compiler errors
ihsan314 Jun 27, 2022
1d72c28
Draft ros_control based hardware interface exposing PointJointInterface
ihsan314 Jul 4, 2022
15b92bf
Added publisher side for teensy interface with arm. Cartesian mode wi…
TateKolton Jul 5, 2022
f406bc7
added files for subscriber side of arm teensy interface
TateKolton Jul 5, 2022
7c100a8
Created subscriber side of pro to teensy communication. Ihsan to fill…
TateKolton Jul 5, 2022
348dc9e
teensy driver and firmware progress
TateKolton Jul 13, 2022
b8c52e4
Add libserial code to arm_hardware_driver node
ihsan314 Jul 14, 2022
bb780dc
Add CmakeLists and package.xml
ihsan314 Jul 14, 2022
f2e729a
xbox mode implementation and hardware interface beginning
TateKolton Jul 15, 2022
0600cef
updated teensy firmware to account for differential wrist joint
TateKolton Jul 22, 2022
22d02a4
progress:
TateKolton Jul 25, 2022
27f0e00
Add ability to toggle usage of MoveIt
ihsan314 Jul 25, 2022
5ed1701
Sketch communication between hardware driver & interface
ihsan314 Jul 25, 2022
0107bc6
Resolve compiler errors asides from serial communication issues
ihsan314 Jul 26, 2022
b591f3b
added HW interface / driver pub/sub implementations for communication…
TateKolton Jul 26, 2022
ccbf09d
updated force feedback flow
TateKolton Jul 26, 2022
530d4ac
updated force feedback flow
TateKolton Jul 26, 2022
9c6e285
updated teensy firmware to fix compiler errors, restructured joint po…
TateKolton Jul 27, 2022
4bce86c
Populate and receive vector in sb_msgs/ArmPosition message
ihsan314 Jul 27, 2022
18e731a
adjusted arm motion parameters
TateKolton Jul 27, 2022
447675c
fixed bug
TateKolton Jul 27, 2022
f861477
Resolve compilation errors
ihsan314 Jul 27, 2022
01fedbc
fixed pro controller error and caught a few bugs in hardware driver
TateKolton Jul 28, 2022
61b6cd0
ihsan fix
TateKolton Jul 28, 2022
76eec63
functioning firmware for axes 1-4
TateKolton Jul 29, 2022
84a7eea
fixed hardware driver bug
TateKolton Jul 29, 2022
5fb0257
changes made for debugging
TateKolton Jul 28, 2022
2e25c41
Change termination condition
TateKolton Jul 29, 2022
7d34b79
Add missing else condition to prevent segfault
TateKolton Jul 29, 2022
a2502c9
Fix install script
TateKolton Aug 1, 2022
83ce2b7
Resolve compilation errors
TateKolton Aug 1, 2022
0ae28dc
Clean up arm hardware interface code and add position limits to confi…
TateKolton Aug 2, 2022
191044e
Resize encPos vector
TateKolton Aug 2, 2022
d625aec
Experiment with new launch file and parameters
TateKolton Aug 3, 2022
ac3c13f
Add config files to hardware interface package
TateKolton Aug 3, 2022
c997924
Load arm urdf in launch file
TateKolton Aug 3, 2022
7cc414d
Add modified demo.launch file and named it experiment.launch
TateKolton Aug 3, 2022
4e920cd
Fix config files and launch file
TateKolton Aug 3, 2022
65d5904
added automatic planning and execution based on timer event
TateKolton Aug 3, 2022
05c1a30
Adjust parameters in yaml config files again
TateKolton Aug 3, 2022
8ee43f3
Add timerEvent parameter to timer callback
TateKolton Aug 4, 2022
5c0c141
Adjust *.yaml and launch files again
TateKolton Aug 4, 2022
619d1a8
Add ROS_INFO and remove extra joint_state_controller
TateKolton Aug 4, 2022
95238bd
Upload CMakeLists.txt and package.xml to git
TateKolton Aug 4, 2022
b1589de
Adjust yaml and launch files to get moveit plans to execute
TateKolton Aug 4, 2022
a2a1fa9
final adjustments to speed settings
TateKolton Aug 6, 2022
58d7a1b
Apply debugging fixes from Adam
TateKolton Aug 6, 2022
ba29608
Remove comments on driver to hardware interface communication
TateKolton Aug 6, 2022
53ae72e
Add joint limits, fix encoder equation, comment out timer function
TateKolton Aug 6, 2022
aee6be5
fw changes
TateKolton Aug 6, 2022
e5aac78
update
TateKolton Aug 6, 2022
65c7f8a
Only execute timer function when in cartesian mode
TateKolton Aug 6, 2022
c55f30a
Fix mapping of wrist button presses
TateKolton Aug 6, 2022
2098539
Remove joint offsets
TateKolton Aug 7, 2022
f1661bf
test
TateKolton Aug 7, 2022
16c22ee
added encoder fix
TateKolton Aug 7, 2022
c19802a
added open loop encoder feedback
TateKolton Aug 7, 2022
ba02d3c
progress
TateKolton Aug 7, 2022
7b3902d
Fix position, velocity, and acceleration limits
TateKolton Aug 7, 2022
f4bf43c
Invert controller buttons for wrist control and remove overwritten jo…
TateKolton Aug 7, 2022
f2a766a
Close communication loop between driver and interface
TateKolton Aug 8, 2022
113884d
added end effector firmware, removed ros_info from driver to clean up…
TateKolton Aug 8, 2022
2cca40e
added end effector firmware, removed ros_info from driver to clean up…
TateKolton Aug 8, 2022
7aaf37d
added simplified drill mode implementation
TateKolton Aug 8, 2022
a237fab
added DRIVER INITIATED position and end effector force feedback based…
TateKolton Aug 8, 2022
96ea969
updated joint limits to reflect actual arm
TateKolton Aug 8, 2022
078b11a
added functions to header file and updated HW interface for tolerance…
TateKolton Aug 8, 2022
90b67fc
ensured that homing blocks serial comm from callbacks/joy controller
TateKolton Aug 8, 2022
0ae6f33
Resolve compilation errors
TateKolton Aug 9, 2022
3bb62b3
Fix timing logic for joint space mode
TateKolton Aug 9, 2022
c93606d
wrist axes inversion
TateKolton Aug 8, 2022
88d6bf0
testing
TateKolton Aug 9, 2022
da1a73b
evening-fix
TateKolton Aug 9, 2022
b1b14bf
removed send current position after homing
TateKolton Aug 9, 2022
f8fe037
fixes for HW interface and firmware
TateKolton Aug 9, 2022
bed7962
tuesday morning fixes
TateKolton Aug 9, 2022
70c339a
Remove checks for serial flags
TateKolton Aug 10, 2022
9627af7
teensy-firmware-updated
TateKolton Aug 10, 2022
d3b05cd
added end effector homing button for cartesian/JP modes
TateKolton Aug 10, 2022
072ec50
evening commit 2
TateKolton Aug 10, 2022
6779cbb
prog1
TateKolton Aug 10, 2022
ecfee27
added move group interface for joint space mode
TateKolton Aug 10, 2022
bcd43ce
added move group execution based on mode switching
TateKolton Aug 10, 2022
61dc301
fixed firmwrae directional problem when switching back to joint mode:
TateKolton Aug 10, 2022
b55b169
Invert controller axes in wheel mode and make speed adjustable (#421)
ihsan314 Aug 8, 2022
87a6ea5
Add ROS driver for Piksi gps module (#416)
Roozki Aug 9, 2022
4df1fd3
Added publisher side for teensy interface with arm. Cartesian mode wi…
TateKolton Jul 5, 2022
0c3aa83
teensy driver and firmware progress
TateKolton Jul 13, 2022
5fab82e
xbox mode implementation and hardware interface beginning
TateKolton Jul 15, 2022
784c10e
Add ability to toggle usage of MoveIt
ihsan314 Jul 25, 2022
a5188ba
Fix install script
TateKolton Aug 1, 2022
dd31298
Resolve compiler errors
TateKolton Aug 10, 2022
79b890f
Remove armFirmware.cpp from messy rebase
TateKolton Aug 10, 2022
0214ed3
Controller deadzone increase, wheel speed reduction, temporary remova…
TateKolton Aug 13, 2022
a9bc530
Adjust timer and serial communication settings
TateKolton Aug 13, 2022
406ffd0
comp day 1 working FW
TateKolton Aug 13, 2022
7715d1c
comp day 2 working code
TateKolton Aug 13, 2022
9e6caf6
night 2 working code, updated home position
TateKolton Aug 14, 2022
1265271
Add udev rules for teensy to install script
TateKolton Aug 13, 2022
c2d57c4
eirasnt
Roozki Aug 13, 2022
200211e
Remove cartesian/drilling mode
TateKolton Aug 14, 2022
930806a
EXPERIMENTAL: changed axes for rowan's convenience
TateKolton Aug 14, 2022
e256760
comp night 3 experimental commit
TateKolton Aug 15, 2022
180df5c
Add ROS driver for Piksi gps module (#416)
Roozki Aug 9, 2022
6bfea4c
Arcu detection (#419)
Roozki Aug 14, 2022
4b9cbd7
Added publisher side for teensy interface with arm. Cartesian mode wi…
TateKolton Jul 5, 2022
a7a8100
teensy driver and firmware progress
TateKolton Jul 13, 2022
196706f
xbox mode implementation and hardware interface beginning
TateKolton Jul 15, 2022
c7a3921
Add ability to toggle usage of MoveIt
ihsan314 Jul 25, 2022
2156e34
Fix install script
TateKolton Aug 1, 2022
f33485f
Invert controller axes in wheel mode and make speed adjustable (#421)
ihsan314 Aug 8, 2022
eefc191
Add ROS driver for Piksi gps module (#416)
Roozki Aug 9, 2022
c76f3bd
Fix topic subscription in markers
TateKolton Aug 15, 2022
4040f36
Resolve compile errors from rebasing
TateKolton Aug 15, 2022
5ee6f43
stash
TateKolton Aug 15, 2022
6a7c03c
update
TateKolton Aug 15, 2022
02adb0a
competition-firmware
TateKolton Aug 23, 2022
aa4283a
Fix left joystick logic and modularize deadzone
TateKolton Aug 15, 2022
0376620
Controller improvements in deadzone and wheel speed
TateKolton Aug 15, 2022
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
Prev Previous commit
Next Next commit
Fix left joystick logic and modularize deadzone
  • Loading branch information
TateKolton authored and ihsan314 committed Aug 28, 2022
commit aa4283af27f69edeed99997161c8508da7596d9d
1 change: 1 addition & 0 deletions src/procontroller_snowbots/include/ProController.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class ProController {
private:
void setup();
void readInputs();
bool inDeadzone(int value);
void leftJoystickX(int value); // ABS_X
void leftJoystickY(int value); // ABS_Y
void rightJoystickX(int value); // ABS_RX
Expand Down
37 changes: 18 additions & 19 deletions src/procontroller_snowbots/src/ProController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,14 @@ void ProController::publishArmMessage(std::string outMsg) {
pubarm.publish(outMsgWrapper);
}

bool ProController::inDeadzone(int value) {
return value > 108 && value < 148;
}

// Updates z, which is then published by publish___XZ in readInputs()
void ProController::leftJoystickX(int value) {

if (value > 110 && value < 140) {
if (inDeadzone(value)) {
if(state == Mode::wheels) {
x = 0;
}
Expand All @@ -216,7 +220,7 @@ void ProController::leftJoystickX(int value) {

// Updates x, which is then published by publish___XZ in readInputs()
void ProController::leftJoystickY(int value) {
if (value > 110 && value < 140) {
if (inDeadzone(value)) {
if(state == Mode::wheels) {
z = 0;
}
Expand All @@ -226,28 +230,23 @@ void ProController::leftJoystickY(int value) {
}
} else {

if(state == Mode::wheels)
{
// 128 is the center, so this normalizes the result to
// [-1,1]*X_SENSITIVITY
ROS_INFO("Left Joystick Y event with value: %d\n", value);
z = -(value - 128) / 128.0 * Z_SENSITIVITY;
// 128 is the center, so this normalizes the result to
// [-1,1]*X_SENSITIVITY
ROS_INFO("Left Joystick Y event with value: %d\n", value);
z = -(value - 128) / 128.0 * Z_SENSITIVITY;
if(z < 0) {
armOutVal = leftJSU;
}
else {
if(z < 0) {
armOutVal = leftJSU;
}

else {
armOutVal = leftJSD;
}
else {
armOutVal = leftJSD;
}
}
}

// Currently doing nothing
void ProController::rightJoystickX(int value) {
if (value > 118 && value < 137) {
if (inDeadzone(value)) {
// do nothing
} else {
ROS_INFO("Right Joystick X event with value: %d\n", value);
Expand All @@ -256,8 +255,8 @@ void ProController::rightJoystickX(int value) {

void ProController::rightJoystickY(int value) {

if (value > 118 && value < 137) {
if(mode != Mode::wheels)
if (inDeadzone(value)) {
if(state != Mode::wheels)
armOutVal = rightJSRel;
}

Expand All @@ -271,7 +270,7 @@ void ProController::rightJoystickY(int value) {
// Right joystick is only used in Y direction in all arm modes
if(state != Mode::wheels) {

if(z > 0) {
if(z < 0) {
armOutVal = rightJSU;
}

Expand Down