Skip to content

Shaun teleop - basic teleop control + estop and zero_state buttons#153

Open
shgupte wants to merge 9 commits intodevelfrom
shaun-teleop
Open

Shaun teleop - basic teleop control + estop and zero_state buttons#153
shgupte wants to merge 9 commits intodevelfrom
shaun-teleop

Conversation

@shgupte
Copy link
Copy Markdown

@shgupte shgupte commented Feb 25, 2026

No description provided.

Copy link
Copy Markdown
Contributor

@imzaynb imzaynb left a comment

Choose a reason for hiding this comment

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

Look at what I have so far, and then when you push that, I will look at the testing stuff.

Good work!

Comment thread Dockerfile
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If possible, remove this file from your commit. The tagged line is supposed to be commented out unless you are on Mac. Thanks!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What's the purpose of this file? From what I can see there is only one source file which is joystick_teleop_continuous.py.

The file is attempting to launch a non-existant node joystick_teleop. The only node that exists currently is joystick_teleop_continuous. These nodes are registered with ROS2 in the setup.py.

Maybe remove this file?

Comment thread mrobosub_teleop/mrobosub_teleop/joystick_button.py Outdated
self._is_pressed = is_pressed

@property
def just_pressed(self) -> bool:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does this suffice for debouncing? I'm curious.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I think yes-- since we are reading from a pretty high level ROS node for the joystick, I believe the node will hand debouncing and we can assume that any outputs from the controller are 'ideal'.

Comment thread mrobosub_teleop/mrobosub_teleop/joystick_button.py Outdated
def __init__(self) -> None:
super().__init__("joystick_teleop_continuous")

params_path = self.declare_parameter(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You don't need to load parameters in this way.

ROS will handle loading in the yaml file under the folder mrobosub_teleop/params/<file>.yaml provided you specify this file in the launch file. I explained this within the launch file above.

Additionally, you will want to change the format of your file to be inline with the way that ROS expects to load in parameters from your files. A good example of this is mrobosub_hal/params/thruster_controller_params.yaml

From there, you can use Muskaan's parameter loading to handle loading in the parameters.

Step 1: List out all parameters

import Param from mrobosub_lib

Then create a list of parameters, perhaps called params, based off of the parameters in your param file.

params = [Param("deadzone", Parameter.Type.INTEGER, "The deadzone of the controller"), <more parameters here>]

I think they should work with the nested parameters that you provided with the dictionary. Test it out if you can. If this doesn't work, I am sure we can make our parameter abstraction more robust to handle it.

Step 2: Declare parameters

After you create the list of parameters, you need to declare them with the node, like such:

self.declare_params(params)

Step 3: Use the params

The parameters will now be available under self.<param> for instance, self.deadzone, etc. And these parameters will automatically refresh if they are changed from, for instance, RQT.

Comment thread mrobosub_teleop/mrobosub_teleop/joystick_teleop_continuous.py Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overall, the file looks really solid, good job. Please consider the changes I suggest if you can.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

See if you can change the formatting of this file to use the ros params way instead.

Comment thread mrobosub_teleop/test/test_joystick_integration.py
@shgupte
Copy link
Copy Markdown
Author

shgupte commented Apr 1, 2026

was able to get to everything except the param loading, not sure I quite undertand how ROS does it, will take a look tomorrow

shgupte and others added 3 commits April 1, 2026 02:11
refactored to use enums; function map for button actions; more accurate button state tracking; naming conventions; still need to address param loading style,
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