-
Notifications
You must be signed in to change notification settings - Fork 416
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
Teleop panel #561
base: master
Are you sure you want to change the base?
Teleop panel #561
Conversation
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.
Thanks for your contribution. Added a few comments. There are some lint errors in CI. If you are using vscode, you could install eslint
to auto format the code. Let me know if you need any help.
return { error, parsedObject }; | ||
} | ||
|
||
class Teleop extends React.PureComponent<Props, PanelState> { |
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.
Could you convert this component to functional component. We've converted the majority of components but still a few left. Would be nice to use the new syntax.
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.
Done (I think so, at least, I don't really work on React and so I had to google what a functional component is). Can you confirm that I actually converted the component to functional style, please?
type="text" | ||
value={config.topicName} | ||
onChange={(event) => { | ||
saveConfig({ topicName: event.target.value }); |
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.
Would need some data validation to ensure the saved topic name is valid
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.
Not sure about what would be required to validate the topic. Would it require checking that the topic name exists and it's of the correct datatype? Doing that would limit use a lot, I think, since it may very well happen that the topic doesn't "exist" since no other nodes have ever published to it, and the Teleop panel will be the only one publishing. Any pointers?
Perhaps a) if it doesn't exist, just accept it, and b) if it already exists, ensure that the datatype is actually "geometry_msgs/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.
Sorry about the late reply. A simple validation like this should be ok:
- name is not empty
- name should start with
/
- name should be at least 2 characters
You could refer to some of the validators here: https://github.com/cruise-automation/webviz/blob/master/packages/webviz-core/shared/validators.js#L102-L107
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.
I've added some validation on 671f133. It shows an error message on the panel if those conditions are not met. It also disables all the buttons and keypresses do nothing.
Remove color setting for buttons Add help popup
@jreyesr I tried the changes (granted, I might be missing something as well!) but I couldn't get the pop up panel for the add panel or change panel to list the teleop as an option... is there something else that has to changes after making those changes? thanks! From the pictures, I love the functionality, great! Edit to add: I think it works if you run
but I don't see it when I try
and host the static_webviz directory, must be some nuance between the 2 that I haven't picked up on yet. Edit to add: Working on Chrome, but not Edge (not a big deal!) the option doesn't show up in Edge... and getting an error
|
@jaguardo Weird. I just ran |
@vidaaudrey I added a few commits fixing the linter errors and converting to a functional component. CI still fails, but the error now happens when attempting to upload something (screenshots, I think) to S3; the error says |
For anyone watching this issue - we recently added a teleop panel to Foxglove Studio (webviz fork) in #1429. |
@jreyesr Doesn't work for me either. I did a clean build and it doesn't show up with |
(First time contributor, so apologies for any mistakes)
Summary
This PR adds a Teleoperation panel which operates in a similar way to the teleop_twist_keyboard node. It can be controlled by clicking buttons or with the arrow keys.
The main motivation of this change would be its use in remotely controlled (i.e., non-autonomous) robots. Such robots can't currently be easily controlled via Webviz (at least, I don't know of a simple way), and it would be nice to have the teleoperation interface next to, for example, an Image panel showing the robot cameras, or a Map panel showing the robot location (or both!).
This PR started by copying the Publish panel, since its functionality is similar. The major difference is that the Teleop panel sends specific messages to a fixed (configurable) topic with a fixed (non-configurable) datatype, instead of arbitrary mesages to any topic. Unnecessary settings were deleted, and the UI was edited to only contain a few buttons which trigger a message publication via a Publisher component. A global KeyListener element was also added, to allow keypresses to also trigger the messages.
Test plan
The new panel was manually tested on a local installation, with ROS running on a Docker container and the Websockets server exposed via port 9090. This change makes no sense when using local or remote bags.
The test files from the Publish panel were also copied, adapted and run. All tests pass successfully.
Versioning impact
This PR should only require a minor semver update.
Addendum: Known limitations & questions