Conversation
…obot-snapshot-gamemode
deletes also files so only the last 5 items are in the folder
.gitignore
Outdated
| /venv/ | ||
| /.idea/ | ||
| log/ | ||
| install/ No newline at end of file |
There was a problem hiding this comment.
Could you move these to the top-most "section"? That keeps the .gitignore (kind of) organised
plus timer error in camera_capture
|
finished enough for the event (@RemcoMusic ), only we need to check if it works to have a livestream on the front end before merging. We can make it nicer after the event. |
WPDOrdina
left a comment
There was a problem hiding this comment.
A quick looks tells me that the code is fine for now. As discussed, we will look into this more after the two upcoming events.
Please take a look at my comments and make some small fixes. After that, let's merge!
| with open("livestream/output.mp4", mode="rb") as stream_file: | ||
| yield from stream_file | ||
| return StreamingResponse(iter_file(), media_type='text/event-stream') | ||
| # return StreamingResponse(iter_file(), media_type='video/mp4') No newline at end of file |
| cd ~/robotics-workshop | ||
| chmod +x host_rtsp_server | ||
| colcon build --symlink-install && source install/local_setup.bash | ||
| colcon build && source install/local_setup.bash |
There was a problem hiding this comment.
I propose to keep the "--symlink-install" in the build-command, as it should keep the amount of times to build the code again to a minimum
| self.image_location = f"{json_settings['image_location']}" | ||
| self.image_counter = 0 | ||
|
|
||
| def start_livestream_callback(self, topic_msg: Bool): |
There was a problem hiding this comment.
The function name does not really reflect its function, as it starts and stops the livestream. Would livestream_state_callback be an option for you?
| self.get_logger().debug( | ||
| "can't stop livestream because livestream is already stopped" | ||
| ) | ||
| elif not self.cap.isOpened(): |
| timer.destroy() | ||
| except UnboundLocalError: | ||
| self.get_logger().error("timer was is not defined)") | ||
| else: |
There was a problem hiding this comment.
When would this else-statement be reached? It seems topic_msg.data is always True or False, so this is never reached right?
| ) | ||
|
|
||
| return LaunchDescription([ | ||
| # launch_include, |
| self.publisher_ = self.create_publisher(Twist, publish_topic, 1) | ||
| self.publisher2 = self.create_publisher(String, '/trigger', 1) | ||
| self.pub_joystick = self.create_publisher(Twist, publish_topic, 1) | ||
| self.pub_camera_trigger = self.create_publisher(Bool, '/camera/cam_0/snapshot/trigger', 2) |
There was a problem hiding this comment.
Ideally these are changed to variable arguments from the configuration file, but lets not do that now
| configuration = json.load(config_file) | ||
|
|
||
|
|
||
| # Define launch arguments that can be set from the command line using |
| Image, topic, self.listener_callback, queue_size | ||
| ) | ||
| self.bridge = CvBridge() | ||
| # os.environ['DISPLAY']=':0' |
| ) | ||
| self.out.write(frame) | ||
| self.out.release() | ||
| # cv2.imshow("frame", frame) |
Snap shot, live stream within one node. both uses the same gstreamer pipline and can be runned at the same time.
enable snapshot or livestream on trigger/state topics.