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

(WIP) Arm autonomy #4

Open
wants to merge 109 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
893d86a
Initial commit for bringing over 2019/20 files for arm autonomy
kira-the-engineer Dec 21, 2020
02ad483
Initial commit of package for ros_control files.
kira-the-engineer Dec 27, 2020
2962c08
ros_control specific launch file for rover_arm_control directory.
nairnhoc Dec 27, 2020
222cca4
fixed version of ros control launch file.
nairnhoc Dec 27, 2020
aa66b3e
Rearranged files and added work in progress HW Interface
kira-the-engineer Dec 27, 2020
00d8421
Merge branch 'arm-autonomy' of https://github.com/OSURoboticsClub/Rov…
kira-the-engineer Dec 27, 2020
443cce0
Small edit to arm control launch file (it was entirely commented out)
kira-the-engineer Dec 27, 2020
cf3a3c1
Added vectors for velocity, effort, position, and cmd values
kira-the-engineer Dec 27, 2020
d563ae2
Added package xml file- has not been compiled yet
kira-the-engineer Dec 27, 2020
b0813a6
Added necessary files for CMake so folder can be compiled in catkin w…
kira-the-engineer Jan 2, 2021
a999f1e
Fixed compilation errors by adding a namespace to the hardware interf…
kira-the-engineer Jan 2, 2021
dfb4f02
Changed 'controllers' to 'config'
kira-the-engineer Jan 2, 2021
99a7316
Created launch file to upload urdf to parameter server for ros_control
kira-the-engineer Jan 2, 2021
f3e2302
fixed xml syntax error for calling upload
kira-the-engineer Jan 2, 2021
9bf70cb
Minor changes to HW interface- begin read function
kira-the-engineer Jan 2, 2021
ab69445
Added folder with files for the simplemotion protocol
kira-the-engineer Jan 2, 2021
23e6be7
fix/clean files for simplemotion folder
kira-the-engineer Jan 7, 2021
44249df
Added simplemotion variables + basic function prototypes in for readi…
kira-the-engineer Jan 9, 2021
ee8b1a5
Modified CMake params
kira-the-engineer Jan 9, 2021
0bb8911
roll back changes to cmake
kira-the-engineer Jan 9, 2021
a0c3125
More edits to variables for setting up arm state code
kira-the-engineer Jan 9, 2021
578a398
Finished constructor for ArmState class- working on reworking plans f…
kira-the-engineer Jan 9, 2021
aa35018
Modified getter functions to take in a reference to a vector for use …
kira-the-engineer Jan 9, 2021
563b3a8
Finished writing functions for getting effort and velocity (not compi…
kira-the-engineer Jan 10, 2021
5879b32
Finished arm state code for reading in values from the controllers
kira-the-engineer Jan 16, 2021
e6e8eef
Finished read function (has not been tested)
kira-the-engineer Jan 16, 2021
17d7aa9
Added code for writing (not tested)
kira-the-engineer Jan 23, 2021
567d4b2
Created a basic node for the hardware interface and modified the laun…
kira-the-engineer Jan 30, 2021
0a936da
Changed CMake to include executable for the hardware interface, curre…
kira-the-engineer Feb 6, 2021
f8d56f7
Mitigated most of the compiler errors, but getting problems with the …
kira-the-engineer Feb 7, 2021
c3ce19b
Fixed weird vtable error by adding a destructor with nothing in it. W…
kira-the-engineer Feb 13, 2021
ce5a2cc
Fixed error with undefined destructor- I guess I needed to create a d…
kira-the-engineer Feb 13, 2021
c6bbef5
Cleaned up CMAKE file to be a bit easier to read, but still getting a…
kira-the-engineer Feb 13, 2021
7142fe4
Fixed the error- it was incredibly stupid, but I forgot to add the ac…
kira-the-engineer Feb 13, 2021
002b41b
Made some edits to how the controllers are structured and launched in…
kira-the-engineer Feb 20, 2021
f1098aa
update arm joints file to be called 'hardware'
kira-the-engineer Feb 20, 2021
22bf76b
Finally configured controller manager in a way where controllers succ…
kira-the-engineer Feb 20, 2021
73c0e4d
Put moveit controller in proper namespace so it can see follow joint …
kira-the-engineer Feb 20, 2021
9902cd0
Edits for arm controller launching
kira-the-engineer Feb 27, 2021
4a4aa32
Updated main node to be multithreaded for testing purposes- still loo…
kira-the-engineer Feb 27, 2021
dc67fee
Small changes in CMake and HW Interface header to get ready to implem…
kira-the-engineer Feb 27, 2021
e6e3f98
Added base functionality for joint limits- it's still a work in progress
kira-the-engineer Feb 28, 2021
1dfaaba
Finished writing saturation joint functionality for hw interface, nee…
kira-the-engineer Mar 4, 2021
e934184
Fixed error with saturation handle, arm_control now launches with no …
kira-the-engineer Mar 6, 2021
ee37dd4
Changed gazebo controller to match the namespace of the actual contro…
kira-the-engineer Mar 6, 2021
74df91a
Work in progress README/Docs for all the arm autonomy packages
kira-the-engineer Mar 6, 2021
842056a
Added descriptions for some of the packages to the README as well as …
kira-the-engineer Mar 6, 2021
74e7276
fixed links
kira-the-engineer Mar 6, 2021
2ea29ba
Added folder for collada files + started documentation for IK
kira-the-engineer Mar 6, 2021
a6afd14
fixing readme formatting
kira-the-engineer Mar 6, 2021
077f253
more ik docs stuff
kira-the-engineer Mar 6, 2021
598b8e2
Updated README to indicate more steps in the IK solution/plugin gener…
kira-the-engineer Mar 13, 2021
23eb48f
minor formatting changes for readme
kira-the-engineer Mar 13, 2021
72ed06f
fixed markdown issues??
kira-the-engineer Mar 13, 2021
6d4c371
Changes to support new IK plugin
kira-the-engineer Mar 13, 2021
c791880
IK solver package has been generated and launches... still getting pa…
kira-the-engineer Mar 20, 2021
6799f0a
Changes to docs for arm autonomy- finished main IK section
kira-the-engineer Mar 20, 2021
5f0b00b
Remove duplicate moveit arm folder. Use the one in arm_ik
kira-the-engineer Mar 20, 2021
2a0d558
Created package for fake/simulation version of ros control + updated …
kira-the-engineer Apr 3, 2021
3bc0bae
Started writing header file for fake hw interface
kira-the-engineer Apr 3, 2021
0bd183b
Added basic functions - still looking into how to best "fake" the har…
kira-the-engineer Apr 3, 2021
f5bb74f
Finished copying over functionality from real hw interface + adding v…
kira-the-engineer Apr 10, 2021
3132161
Started creating the cpp file for the fake hardware interface
kira-the-engineer Apr 10, 2021
9f8999f
Added functionality for simulated joints
kira-the-engineer Apr 10, 2021
84a3860
Added main functions for hw interface + edited minor errors
kira-the-engineer Apr 10, 2021
e7e304a
Made bug fixes + added node
kira-the-engineer Apr 10, 2021
f1324f5
starting to create launch files to verify the fake version of ros con…
kira-the-engineer Apr 10, 2021
171a7a8
Changes involving values/troubleshooting for simulated ros control. A…
kira-the-engineer Apr 24, 2021
3c57549
Fake ros control now works in sim!!!! Velocity limits are ignored, wh…
kira-the-engineer Apr 24, 2021
8085798
Updated README to talk about simulation
kira-the-engineer Apr 24, 2021
f68a2e2
Updated URDF and IKFast Plugin to have correct joint limits
kira-the-engineer May 1, 2021
2d9926b
Minor changes necessary for enforcing joint limits- currently investi…
kira-the-engineer May 1, 2021
6479de3
Reverted to using URDF limits as rosparam was unable to find the nece…
kira-the-engineer May 15, 2021
47d19ae
Preliminary message file for ROS control integration with the grounds…
kira-the-engineer May 22, 2021
c768da7
Prelim controls file, still determining what messages/topics need to …
kira-the-engineer May 22, 2021
6f2deb0
Initial commit for changes to UI. The only thing needed to bring up M…
May 23, 2021
e2b4ef5
Further work on setting up variables for ros control itegeration with…
kira-the-engineer May 29, 2021
d345747
Continued work on setting up interface with groundstation
kira-the-engineer May 29, 2021
70d280b
merging to stay current with latest arm-autonomy branch
Jun 3, 2021
4a8fd19
Added single-screen version of groundatation UI for testing purposes.…
Jun 4, 2021
e7a2f29
Reconfiguring stop/start IK
kira-the-engineer Jun 5, 2021
2138bdc
Finished (?) cpp side for the ik control monitoring
kira-the-engineer Jun 5, 2021
fbac8be
preliminary code for ikcontrols script
kira-the-engineer Jun 5, 2021
983ac6a
Updated the python side of things, still learning abt PyQt
kira-the-engineer Jun 12, 2021
699539c
Setting up framework for groundstation side of the code + slightly mo…
kira-the-engineer Jun 19, 2021
cc9eb3f
Wrote function for publishing message when the start button is presse…
kira-the-engineer Jun 24, 2021
cca756e
Added connection for start button, still working on signal/slot conne…
kira-the-engineer Jun 24, 2021
0966437
MoveIt Rviz Visualization now integrated into the groundstation. Run …
Scarabax Jun 25, 2021
6144501
Remove unused packages, added comments, and changed some non-sensical…
Scarabax Jun 26, 2021
4c378e6
Finished creating variables for ik control, need to figure out a way …
kira-the-engineer Jun 26, 2021
2ea92e4
merge ik items into misc arm core
kira-the-engineer Jun 26, 2021
084ad2f
Adding launch files and topic transports for ros control stuff
kira-the-engineer Jun 30, 2021
a35eedc
Created basic UI for toggling IK and added topics to senders + reciev…
kira-the-engineer Jul 3, 2021
d1934c5
Added IK Stop button + basic documentation for running the arm using …
kira-the-engineer Jul 3, 2021
cc8f856
Added functionality to dual screen version of the groundstation.
Scarabax Jul 9, 2021
c8ee336
Minor syntax fixes/changes
kira-the-engineer Jul 16, 2021
d7e03e0
Organized some files
Scarabax Jul 17, 2021
bb71789
Removed redundant files from testing
Scarabax Jul 17, 2021
d875210
Initial commit
Scarabax Jul 17, 2021
89c111b
Changed files to support MoveItUI
Scarabax Jul 17, 2021
246f095
Synced version of branches arm-ik-ui and arm-autonomy. Launching grou…
Scarabax Jul 17, 2021
a108b3c
Added sender for rover side control booleans
kira-the-engineer Jul 21, 2021
9dbe769
changed filepath for ik msg file
kira-the-engineer Jul 25, 2021
2d5d4cf
changed file path for msg files for ik
kira-the-engineer Jul 25, 2021
c26ed7b
Merge pull request #6 from OSURoboticsClub/arm-autonomy_moveit-ui
kira-the-engineer Jul 25, 2021
b85bfa4
Updated cmake to fix errors
ChenHuang000 Jul 25, 2021
76ede75
Actually fixed the cmake issues this time (kira)
ChenHuang000 Jul 25, 2021
c7603ea
Fixed a couple of errors in the MiscArm file
kira-the-engineer Jul 31, 2021
f15c462
Minor edits to py file to re-add MiscArmCore
kira-the-engineer Aug 2, 2021
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# coding=utf-8
#####################################
# Imports
#####################################
# Python native imports
from PyQt5 import QtCore, QtWidgets, QtGui
import sys
import signal
import logging
import rospy

from rover_arm_control.msg import IKControlMessage

#####################################
# Global Variables
#####################################
ARM_CONTROLLER_STATUS = "/rover_arm_control/IKControl/control_status"
ARM_TOGGLE_STATUS = "/rover_arm_control/IKControl/button_status"

class ArmIKControls(QtCore.QObject):
def __init__(self, shared_objects):
controller_start__signal = QtCore.pyqtSignal(str)
controller_status__signal = QtCore.pyqtSignal(str)

# ########## Reference to class init variables ##########
super(ArmIKControls, self).__init__()
self.shared_objects = shared_objects
self.main_screen = self.shared_objects["screens"]["main_screen"]

self.ik_control_start_button = self.main_screen.ik_control_start_button #type: QtWidgets.QButton
self.ik_control_status_label = self.main_screen.ik_control_status_label #type : QtWidgets.QLabel

# ########## Class Variables ##########
self.ik_status_subscriber = rospy.Subscriber(ARM_CONTROLLER_STATUS, IKControlMessage, self.arm_ik_status__callback)
self.ik_status_publisher = rospy.Publisher(ARM_TOGGLE_STATUS, IKControlMessage, queue_size =1)

self.controllers_status = False
self.button_status = False

def arm_ik_status__callback(self,data):
self.controllers_status = data.controllers_started
self.button_status = data.start_button

if self.controllers_started is True:
##Indicate that arm IK is started on groundstation
controller_start__signal.emit(COLOR_GREEN)
else:
##Indicate that are IK is off on groundstation
controller_start__signal.emit(COLOR_RED)

if self.button_status is False:
message.start_button = False
self.ik_status_publisher.publish(message)

def connect_signals_and_slots(self):
self.ik_control_start_button.clicked.connect(self.on_ik_start_button_pressed__slot)
self.controller_status__signal.connect(self.ik_status_publisher.setStyleSheet)

def on_ik_start_button_pressed__slot(self):
message = IKControlMessage()
message.start_button = True
self.button_status = True
self.ik_status_publisher.publish(message)



Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env python

import roslib
import rospkg
import sys
import rospy

#"python_qt_binding" package hides differences between PyQt and PySide
from python_qt_binding.QtGui import *
from python_qt_binding.QtCore import *
from PyQt5.QtWidgets import QApplication, QWidget, \
QVBoxLayout, QHBoxLayout
import rviz

class MoveItInterface(QWidget):
def __init__(self, parent=None):
QWidget.__init__(self)
self.frame = rviz.VisualizationFrame()
self.frame.setSplashPath("") #path to image file shown during loading
self.frame.initialize()

#load rviz config file
reader = rviz.YamlConfigReader()
config = rviz.Config()
reader.readFile( config, "moveit.rviz" )
self.frame.load( config )

self.setWindowTitle( config.mapGetChild( "MoveIt" ).getValue() )
self.frame.setMenuBar( None )
self.frame.setStatusBar( None )
self.frame.setHideButtonVisibility( False )

self.manager = self.frame.getManager()
self.grid_display = self.manager.getRootDisplayGroup().getDisplayAt( 0 )

layout = QVBoxLayout()
layout.addWidget( self.frame )
h_layout = QHBoxLayout()
layout.addLayout( h_layout )
self.setLayout( layout )
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from rover_arm.msg import ArmControlMessage, ArmStatusMessage
from rover_control.msg import GripperControlMessage
from rover_arm_control.msg import IKControlMessage

#####################################
# Global Variables
Expand All @@ -20,6 +21,9 @@

GRIPPER_CONTROL_TOPIC = "/rover_control/gripper/control"

ARM_CONTROLLER_STATUS = "/rover_arm_ik/rover_arm_control/IKControl/control_status"
ARM_TOGGLE_STATUS = "/rover_arm_ik/rover_arm_control/IKControl/button_status"

THREAD_HERTZ = 5

POSITIONAL_TOLERANCE = 0.02
Expand Down Expand Up @@ -54,6 +58,9 @@
# UbiquitiRadioSettings Class Definition
#####################################
class MiscArm(QtCore.QThread):
# ########### define signals for slots ############
controller_status__signal = QtCore.pyqtSignal(str)

def __init__(self, shared_objects):
super(MiscArm, self).__init__()

Expand All @@ -75,6 +82,10 @@ def __init__(self, shared_objects):

self.gripper_toggle_laser_button = self.left_screen.gripper_toggle_laser_button # type:QtWidgets.QPushButton

self.ik_control_start_button = self.left_screen.ik_control_start_button #type: QtWidgets.QPushButton
self.ik_control_stop_button = self.left_screen.ik_control_stop_button #type: QtWidgets.QPushButton
self.ik_control_status_label = self.left_screen.ik_control_status_label #type : QtWidgets.QLabel

# ########## Get the settings instance ##########
self.settings = QtCore.QSettings()

Expand All @@ -90,13 +101,17 @@ def __init__(self, shared_objects):
self.arm_status_subscriber = rospy.Subscriber(ARM_STATUS_TOPIC, ArmStatusMessage,
self.new_arm_status_message_received__callback)

self.ik_status_subscriber = rospy.Subscriber(ARM_CONTROLLER_STATUS, IKControlMessage, self.arm_ik_status__callback)

self.arm_relative_control_publisher = rospy.Publisher(ARM_RELATIVE_CONTROL_TOPIC, ArmControlMessage,
queue_size=1)
self.arm_absolute_control_publisher = rospy.Publisher(ARM_ABSOLUTE_CONTROL_TOPIC, ArmControlMessage,
queue_size=1)

self.gripper_control_publisher = rospy.Publisher(GRIPPER_CONTROL_TOPIC, GripperControlMessage, queue_size=1)

self.ik_status_publisher = rospy.Publisher(ARM_TOGGLE_STATUS, IKControlMessage, queue_size =1)

self.base_position = 0
self.shoulder_position = 0
self.elbow_position = 0
Expand All @@ -110,6 +125,9 @@ def __init__(self, shared_objects):

self.should_package_drop = False

self.controllers_status = False
self.toggle_status = False

def run(self):
self.logger.debug("Starting MiscArm Thread")

Expand Down Expand Up @@ -218,6 +236,10 @@ def connect_signals_and_slots(self):
self.gripper_toggle_light_button.clicked.connect(self.on_gripper_toggle_light_pressed)
self.gripper_toggle_laser_button.clicked.connect(self.on_gripper_toggle_laser_pressed)

self.ik_control_start_button.clicked.connect(self.on_ik_start_button_pressed__slot)
self.ik_control_stop_button.clicked.connect(self.on_ik_stop_button_pressed__slot)
self.controller_status__signal.connect(self.ik_control_status_label.setStyleSheet)

def on_upright_zeroed_button_pressed__slot(self):
self.process_absolute_move_command([0 for _ in range(6)])

Expand Down Expand Up @@ -248,6 +270,18 @@ def on_cobra_arm_button_pressed__slot(self):
def on_package_drop_button_pressed__slot(self):
self.should_package_drop = True

def on_ik_start_button_pressed__slot(self):
message = IKControlMessage()
message.start_button = True
self.toggle_status = True
self.ik_status_publisher.publish(message)

def on_ik_stop_button_pressed__slot(self):
message = IKControlMessage()
message.stop_button = True
self.toggle_status = False
self.ik_status_publisher.publish(message)

def on_gripper_home_pressed(self):
message = GripperControlMessage()
message.should_home = True
Expand All @@ -274,6 +308,17 @@ def new_arm_status_message_received__callback(self, data):
self.wrist_pitch_position = data.wrist_pitch
self.wrist_roll_position = data.wrist_roll

def arm_ik_status__callback(self,data):
self.controllers_status = data.controllers_started
self.button_status = data.start_button

if self.controllers_started is True:
##Indicate that arm IK is started on groundstation
controller_start__signal.emit(COLOR_GREEN)
else:
##Indicate that are IK is off on groundstation
controller_start__signal.emit(COLOR_RED)

def setup_signals(self, start_signal, signals_and_slots_signal, kill_signal):
start_signal.connect(self.start)
signals_and_slots_signal.connect(self.connect_signals_and_slots)
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading