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

[fetch_gazebo] Add option to launch teleop node #105

Open
wants to merge 1 commit into
base: gazebo9
Choose a base branch
from

Conversation

708yamaguchi
Copy link
Contributor

@708yamaguchi 708yamaguchi commented Jul 10, 2020

In this pull request, I add launch_teleop arg to fetch.launch.xml like fetch.launch in fetch_bringup.
https://github.com/fetchrobotics/fetch_robots/blob/melodic-devel/fetch_bringup/launch/fetch.launch

This pull request allows us to operate the fetch in gazebo with joystick.

Example usage (with the joystick USB-connected):

roslaunch fetch_gazebo playground.launch joy_device:="/dev/input/js0"

@708yamaguchi 708yamaguchi requested a review from a team as a code owner July 10, 2020 04:19
@@ -31,9 +34,11 @@
<param name="lazy" type="bool" value="True"/>
</node>

<!-- Start a mux between application and teleop -->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not particularly familiar with the use of mux'ing different command inputs; can you describe why this block is/should be removed? Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your review and sorry for my lack of explanation.

This mux node is actually not removed. This is included in teleop.launch.xml.
https://github.com/fetchrobotics/fetch_robots/blob/5fd6302bd17175c11d0ddfb4171f8513bc82a5b5/fetch_bringup/launch/include/teleop.launch.xml#L27-L29

@NuBot-Cc
Copy link

In this pull request, I add launch_teleop arg to fetch.launch.xml like fetch.launch in fetch_bringup.
https://github.com/fetchrobotics/fetch_robots/blob/melodic-devel/fetch_bringup/launch/fetch.launch

This pull request allows us to operate the fetch in gazebo with joystick.

Example usage (with the joystick USB-connected):

roslaunch fetch_gazebo playground.launch joy_device:="/dev/input/js0"

hi~,I am trying to control the fetch with joystick in gazebo simulation. but it could not
work though I follow your method to modify the ### fetch.launch.xml. Could you use the joystick to control Fetch in gazebo demo? Maybe I did not notice some step. Hope you reply. Thank you!

@708yamaguchi
Copy link
Contributor Author

708yamaguchi commented Aug 31, 2020

@treeofsun-god
Thank you for using my pull request and sorry for the lack of explanation.

My environment is ROS melodic.
To create the workspace, I did the following steps.

mkdir ~/fetch_gazebo_teleop_ws/src/ -p
cd ~/fetch_gazebo_teleop_ws/src/
# Here, copy the following .rosinstall
wstool update
rosdep install --from-paths . --ignore-src -y -r
cd ..
source /opt/ros/melodic/setup.bash
catkin build

.rosinstall which I used in the above:

- git:
    local-name: 708yamaguchi/fetch_gazebo
    uri: https://github.com/708yamaguchi/fetch_gazebo.git
    version: add-teleop

Then, I executed playground.launch like below:

source /opt/ros/melodic/setup.bash
source ~/fetch_gazebo_teleop_ws/devel/setup.bash
roslaunch fetch_gazebo playground.launch joy_device:="/dev/input/js0"

When using this launch file, please make sure that

  • your joy device can be found by $ ls /dev/input/js0
  • pairing to your joy device is done

If joy teleop is succeeded, you can see the /joy topic like below:

# Move forward
$ rostopic echo /joy
header:
  seq: 467
  stamp:
    secs: 37
    nsecs: 152000000
  frame_id: ''
axes: [-0.0, -0.0, 0.0, 1.0, -0.0, 0.0]
buttons: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0]
---

Thanks,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants