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

Feature/joy teleop #85

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
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
Small cleanup
JosjaG committed Jun 15, 2021
commit 81051a243f9836b4373869301506bec781c66e9e
3 changes: 3 additions & 0 deletions launch/hero_bringup.launch
Original file line number Diff line number Diff line change
@@ -206,6 +206,9 @@
<remap from="odom" to="base/measurements" />
</node>

<!-- Joystick controller -->
<include file="$(find hero_bringup)/launch/tools/joy_teleop.launch" />
Copy link
Member

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?


</group> <!-- End of TU/e namespace group -->

</launch>
2 changes: 0 additions & 2 deletions launch/tools/joy_teleop.launch
Original file line number Diff line number Diff line change
@@ -4,8 +4,6 @@
<arg name="namespace" default="/hero" />

<group ns="$(arg namespace)">
<!-- <rosparam command="load" file="$(find hero_bringup)/parameters/tools/teleop.yaml" /> -->

<node name="joy_teleop" pkg="joy" type="joy_node" />

<node name="joy_controls" pkg="hero_bringup" type="joystick_controls_node" />
5 changes: 0 additions & 5 deletions scripts/joystick_controls_node
Original file line number Diff line number Diff line change
@@ -4,12 +4,9 @@ import sys

import rospy
import rosnode
import actionlib
from sensor_msgs.msg import Joy
from geometry_msgs.msg import Twist
from sensor_msgs.msg import JointState
from control_msgs.msg import FollowJointTrajectoryAction, FollowJointTrajectoryActionGoal
from tue_manipulation_msgs.msg import GripperCommandAction, GripperCommandActionGoal
from robot_skills.get_robot import get_robot
from robot_skills.arm import arms

@@ -19,11 +16,9 @@ class JoystickControls(object):
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
Copy link
Member

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.

# self.map = self.controller_mappings[self.controller_mode]
self.controller_sub = rospy.Subscriber("joy", Joy, self.map_joystick, queue_size=1)
self.gripper_state_sub = rospy.Subscriber("joint_states", JointState, self.get_gripper_state, queue_size=1)

# Publish to kill all state_machines, to open/close the gripper, to move the base, loaded trajectory/pose, move the end effector
self.base_pub = rospy.Publisher("base/references", Twist, queue_size=1)
self.robot = get_robot('hero')
self.robot_arm = self.robot.get_arm(required_gripper_types=[arms.GripperTypes.GRASPING], required_goals=['show_gripper'])