Was trying to quickly view my wip particle simulator and so I used matplotlib to plot the particles. Howevever, matplotlib seems to make small adjustments inbetween images. (The images are written in to video using cv2 videowriter).
Does anyone know how to hardset the ranges? (currently using xlim and ylim)
fig.tight_layout()
plt.xlim(xmin-x_axis_buffer,xmax+x_axis_buffer)
plt.ylim(ymin-y_axis_buffer,ymax+y_axis_buffer)
for i in range(nIters):
plt.scatter(data[i,:,0],data[i,:,1],c=[i for i in range(nParticles)],cmap="gist_rainbow")
fig.set_size_inches(8, 6)
_=f'{i:04}.png'
plt.savefig(_, dpi=100)
plt.cla()
output_from_video.gif
Related
We try to set up the Orbbec Astra Embedded S camera with ROS and our goal is to detect objects by reconstructing a 3D point cloud from the camera images. We are using ROS Noetic and the ROS-Package "astra-camera" (https://github.com/orbbec/ros_astra_camera) as well as Rviz to visualize the images and the 3D point cloud.
Here are the rostopics:
/camera/color/camera_info
/camera/color/image_raw
/camera/depth/camera_info
/camera/depth/image_raw
/camera/depth/points
/camera/ir/camera_info
/camera/ir/image_raw
First Issue:
The color (/camera/color/image_raw) and IR (/camera/ir/image_raw) image stream seems to be working fine, but the big issue is the depth (/camera/depth/image_raw) image stream as it is flickering very fast and does not seem to detect anything.
Second Issue:
When launching the camera by running "roslaunch astra_camera astra_pro.launch" we received three warnings:
Publishing dynamic camera transforms (/tf) at 10 Hz
Camera calibration file /home/astra/.ros/camera_info/rgb_camera.yaml not found.
Camera calibration file /home/astra/.ros/camera_info/ir_camera.yaml not found.
By calibrating the color camera using a checkerboard, we were able to solve the 2. warning, as it generated the rgb_image.yaml file containing the intrinsic parameters. We tried calibrating the ir camera as well, but the ir_camera.yaml file was not generated. We have not yet solved the 1. warning.
Even though we are unsure if this is related to the issue regarding the flickering depth image stream, we believe it is worth mentioning.
We are ROS beginners and would be grateful for any feedback that could help us finding a solution. If you need any other or more information, please let us know.
Thanks,enter image description here
The following gif shows the issue Flickering-Issue
I need to track ratchet head using opencv + python (raspberry-pi) in real time. Please refer to the images below.
I have been able to make certain progress there. But really unable to figure out a way to go for the complex shape along with shapes inside a complex shape (as there are circles and screws within).
I would need to also figure out the ratchet from sides but to begin with, I would like to seek support for figuring out the top view of the ratchet only.
Until now I have been able to detect circles in the image which was very straight-forward. I also tried template matching but that doesn't help in this case. I feel that if there is some way to detect the ratchet head by its outer shape and the big circle within, the job would be done.
Please note that the sizes of the ratchet heads will change but the shape roughly remains the same.
I tried using inkscape like gazebo recommends on their website however this did not import into gazebo when I tried and crashed the program a few moments later. I am simply tryng to import a 3x3 grid that I can display on a table in Gazebo
Solution was to disconnect the squares so they appeared as holes in a larger square
Also, one of possible solutions is to add your image on the surface of a .dae mesh.
I'm running matplotlib in a Docker container on my MacBook. When I use plt.show(), it pops open the window on my screen and the figure I've created is just fine, but the text at the lower-left is gibberish (see example, below). How can I get it to show the usual x,y position of the cursor?
Some additional details:
It's a Centos 7 base docker image with our code layered on top. To keep the size down, we don't install the kitchen sink. Perhaps a package or two is missing?
The effect is observed no matter what I plot.
This is using matplotlib 2.0.2 installed via Conda.
The default backend (according to matplotlib.get_backend()) is apparently Qt5Agg.
I get a reasonable result if I use the TkAgg backend.
Qt5 is coming from Conda.
I have a lot of data to plot in a single plot window and it looks really ugly and not understandable. Moreover legends are coming on to the curves which make curves unreadable. I cannot put curve alone one by one into my latex report which makes it again difficult to maneuver between the plots.
My question is- can't it be possible to put all the curves in single plot generated from gnu plot which can be easily maneuver back and forth in a single plot window the latex report?
I know a bit about tikz pictures where no of frameworks can be easily accessible in single plot.
can't it be used for a whole curves one by one assuming as different frame work. and at last all the plots in the the plot window.
It would be very helpful if is possible so.
I have data with N rows and M columns in it. I need plots of N rows vs. each column separately to be shown in each frame in Latex generated report and in the last frame all the curves should be present. I need a proper procedure to follow to animate the curves.
Yes, this kind of thing can be done with the animate package in latex. I have successfully used it in the past for presentations that I put together with beamer. You could switch between different gnuplot graphs that are loaded into the animateinline environment, but you can also use pgfplots within tikz to modify the plot directly on your latex document without need for an external plot.
Using animate requires investing a bit of time at the beginning but the results can be very nice. Also, Okular (and I'm guessing other PDF viewers as well) seem to have trouble visualizing the animations but Adobe reader (acroread on linux) loads them without problems.
As an example, you can check a 5-minute presentation I put together last year: in slides 4 and 5 you can use the buttons to run the animation. The one in slide 4 includes plotting a gaussian with pgfplots changing the curve parameters between frames. You need to open it with the Adobe reader for it to play correctly.