Conversation
Created a publisher and subscriber. Messages are sent to the topic containing the devices attached
hjed
left a comment
There was a problem hiding this comment.
Generally looks good. Feedback around style and process.
Can you please also include the source code for rover/usb_reset.
| <!-- One license tag required, multiple allowed, one license per tag --> | ||
| <!-- Commonly used license strings: --> | ||
| <!-- BSD, MIT, Boost Software License, GPLv2, GPLv3, LGPLv2.1, LGPLv3 --> | ||
| <license>TODO</license> |
There was a problem hiding this comment.
please update these (MIT and info@bluesat.com.au + your info if you want)
| @@ -0,0 +1,63 @@ | |||
| #!/usr/bin/env python | |||
| # license removed for brevity | |||
There was a problem hiding this comment.
please include it - and the other stuff from the standard header format
|
|
||
| """in visudo, need to add %ros ALL = NOPASSWD: /home/ros/owr_software/rover/src/owr_usb_reset/usb_reset | ||
| after %sudo ALL=(ALL:ALL) ALL. This allows the usb reset program to run without needing a password for | ||
| sudo. Eneter password manually while running causes a problem |
There was a problem hiding this comment.
can you check there is not a group that gives this access by default?
If not can you put this setup into a bash script so its easier to setup (put it in the rover/system folder)
| print(devs[data.data]) | ||
| filepath = "/dev/bus/usb/" + devs[data.data][4:7] | ||
| filepath = filepath + "/" + devs[data.data][15:18] | ||
| print(filepath) |
There was a problem hiding this comment.
please use rospy.loginfo logging rather than prints (this allows us to view and controls logs from the ros console)
| print("Out of range") | ||
|
|
||
| def listener(): | ||
| rospy.init_node('usb_reset', anonymous=True) |
There was a problem hiding this comment.
you should only need to call rospy.init_node once
|
|
||
| def listener(): | ||
| rospy.init_node('usb_reset', anonymous=True) | ||
| rospy.Subscriber("rover/usb/reset", Int16, callback) |
There was a problem hiding this comment.
topic name needs to start with /
| rate = rospy.Rate(1) # 1hz | ||
|
|
||
| while not rospy.is_shutdown(): | ||
| subprocess.call("cd /dev/bus/usb",shell=True) |
There was a problem hiding this comment.
you don't need to cd here - just run the other command
Backend system that when it receives a message for a frontend node, resets a given usb device