-
Notifications
You must be signed in to change notification settings - Fork 49
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
feat: Save new/changed behavior on the robot through SSH #21
base: develop
Are you sure you want to change the base?
Conversation
@pschillinger Any comment on this? |
This sounds like an exciting feature and I think it fits perfectly into the concept of the FlexBE app! Thanks a lot for your effort! I wanted to get #19 out of the way, then I will try it out more carefully. |
Hi @alireza-hosseini , Thanks for adding the ssh feature in flexBE App. On your modifications, I have entered Robot's hostname as it's IP and Robot's username in Configuration -> Code Generation Tab, And on clicking save behaviour, it gives "Permission Denied Error". And my .profile contains this code:
Please suggest the changes to be done to make files edit and make it work? |
@utkarsh447 Thanks for trying my proposed feature, |
Thank You very much, It is working as it should! |
* feat: Add input boxes for setting SSH configs - These settings will be used for updating the behavior on the robot according to new changes made on the behavior using flexbe app. * feat: Update the behavior pkg on the robot on saveBehavior clicked - It will create a SSH tunnel to the robot and overwrite the behavior package * build: Major refactoring on package.json - Add dependency to `scp2` * Revert "style: Replace tabs with 4space" * fix: remove spaces only from package path * build: Install node modules from CMakeLists.txt
@utkarsh447 Cool, glad to hear that ;-) |
Thank you for testing @utkarsh447 and thank you again for contributing @alireza-hosseini ! I still have some questions, could you help me with those? I will annotate some in the code for easier reference. Also, did you test this in combination with making runtime modifications? To me, it looks like these two features would interfere when doing an SSH save while a behavior is running/locked. I'm really looking forward to merge this feature! I just want to make sure that nothing breaks, of course. |
@@ -68,3 +68,5 @@ if(CATKIN_ENABLE_TESTING) | |||
find_package(rostest REQUIRED) | |||
add_rostest(launch/test_report.test) | |||
endif() | |||
|
|||
execute_process(COMMAND npm --prefix ${PROJECT_SOURCE_DIR} install) |
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.
This fails if npm is not installed. Do you see a way to automatically handle npm as a dependency?
{ | ||
try | ||
{ | ||
var SSHClient = require('ssh2').Client; |
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.
Shouldn't ssh2 be an npm dependency as well? Even if included in scp2, it is referenced here directly.
username: ssh_username, | ||
password: ssh_password | ||
}); | ||
} |
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'm not sure if I understand the above code block correctly. To me it looks like there is an ssh connection created first and then, within this connection, another scp connection is opened to transfer the file. Do I get it wrong? Or what is the reason for this approach?
ssh_username, | ||
ssh_password, | ||
ssh_hostname, | ||
ssh_package_path); |
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.
This contains the password in plain text, right? Is there a way to encrypt? I have no experience with the scp2 package, but do you know how the query string would be further used?
Change `version` to a Development Tag
What I did:
Used scp2 and ssh2 node modules to update the behavior package on the robot according to new changes made on this package (adding new behavior, modifying an existing one) through SSH.
The SSH configurations (hostname and username) shall be set in new input boxes provided in Code Generation section of Configuration tab. This feature is disabled by default and it can be set to enabled from the same section.
For security reasons (to don't store it as a cookie) password will be prompted on clicking the save behavior button.
Refactored the package.json and added dependency to scp2 module.
Important notes:
npm install
command will be automatically executed duringcmake
.Feature works: