-
Notifications
You must be signed in to change notification settings - Fork 2
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
Feature/joy teleop #85
base: master
Are you sure you want to change the base?
Conversation
…us publishing of command velocities
scripts/joystick_controls_node
Outdated
if abs(mapping['right_stick_horizontal']) < 0.1 and abs(mapping['right_stick_vertical']) < 0.1 and abs(mapping['left_stick_horizontal']) < 0.1: | ||
self.base_command = Twist() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vanwaar dit stuk? Je zou denken dat dit het logische resultaat van alles hierboven.
self.base_command = Twist() | ||
|
||
def publish_controls(self): | ||
self.base_pub.publish(self.base_command) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zit hier geen risico in als er geen input meer komt. Gaat ie dan niet eindeloos doorrijden.
} | ||
self._send_controls(controller_mappings[self.controller_mode]) | ||
|
||
def get_gripper_state(self, state_msg): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cant you take this from the robot object.
a12d44e
to
d55ef54
Compare
@@ -206,6 +206,9 @@ | |||
<remap from="odom" to="base/measurements" /> | |||
</node> | |||
|
|||
<!-- Joystick controller --> | |||
<include file="$(find hero_bringup)/launch/tools/joy_teleop.launch" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only on the robot you want to launch this right?
if state_msg.name[20] == 'hand_motor_joint': | ||
if state_msg.position[20] > 0.6: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The joint could also be at another index. So find index of item in list.
self.base_pub.publish(self.base_command) | ||
|
||
def map_joystick(self, joy_msg): | ||
controller_mappings = {4: {'A': joy_msg.buttons[0], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this a class attribute, so it isn't generated every call
scripts/joystick_controls_node
Outdated
""" | ||
Subscribes to the Joy messages sent via the controller and the joy node and then transforms these to the desired behavior | ||
""" | ||
self.controller_mode = 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also a class attribute, plus maybe add a short explanation.
scripts/joystick_controls_node
Outdated
while not rospy.is_shutdown(): | ||
self.publish_controls() | ||
r.sleep() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This blocks the constructor
if __name__ == "__main__": | ||
rospy.init_node("joystick_controls_node") | ||
ConversionNode = JoystickControls() | ||
sys.exit(rospy.spin()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is never reached as the constructor is blocking.
from robot_skills.arm import arms | ||
|
||
|
||
class JoystickControls(object): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe better to have the class definition in the library
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR should be merged after/together with tue-robotics/tue-env-targets#234. It is clear that the joy package is needed, so that needs to be installed on the machine that will run this code. It would be best to not include this in the package.xml as that would result in it being installed on all machines.
Plus as the ros-joy
target is being changed. Please make clear which other packages are needed, if this is the case.
d55ef54
to
ea1826d
Compare
ea1826d
to
03d1be5
Compare
…ngup into feature/joy_teleop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This requires a dependency on robot_skills. Which we shouldn't. So that requires this code to be moved to a separate/new repo.
I agree that it is an undesired dependency, but I don't think this should be a new repo. Having new repos for small features makes our codebase even less clear/organized. Do we have a different repo that suits this node? |
I disagree, mixing everything together that doesn't belong together does create a big mess in my opinion. Without creating one package with a lot of dependencies, small features do require a separate package. |
What dependency? |
No description provided.