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

control the robot using keyboard #16

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rua0ra1
Copy link
Contributor

@rua0ra1 rua0ra1 commented Sep 4, 2024

Hi @lnotspotl ,
I added the keyboard control using the teleop_twist_keyboard package. Currently, I did the necessary changes to control the robot using keyboard in mpc blind mode. You can have a look at it and let me know your suggestions and comments. If you are happy with my current changes, I will extend it to remaining controllers.
you need to do the following steps

  1. I have already added teleop_twist_package as a dependent to mpc_blind package and also added it as git submodule. I think it should work without any issues. If it not working, you can download the package from here

  2. change type to twist here

type: "joy" #change it to 'twist' to control with keyboard
  1. change joystick argument to false here
   <!-- true if you want to control the robot with joystick/ false to control with keyboard -->
    <arg name="joystick"               default="true"/> 

@@ -25,3 +25,6 @@
[submodule "dependencies/elevation_mapping_cupy"]
path = dependencies/elevation_mapping_cupy
url = [email protected]:lnotspotl/elevation_mapping_cupy.git
[submodule "dependencies/teleop_twist_keyboard"]
Copy link
Owner

Choose a reason for hiding this comment

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

I don't think we need to add teleop_twist_keyboard as a submodule, do we? At the end of the day, if teleop_twist_keyboard is a dependency of any of the ROS packages, the command

cd .. && rosdep install --from-paths src --ignore-src -r -y && cd src/tbai

from the installation guide should install it automatically.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think you are right. But, I got lot of errors and warnings when I executed that command earlier. And I am not sure it is properly setup.

@@ -38,7 +38,7 @@ anymal_d:
joints: *jn

reference_generator:
type: "joystick"
type: "joy" #change it to 'twist' to control with keyboard
Copy link
Owner

Choose a reason for hiding this comment

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

This change will most likely break the reference generator in case one wants to use a joystick.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry you are right. there is a typo. it supposed to be "joystick". i just added the comment next to it.

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.

2 participants