Revolute joints jump out of frame - vrep, bullet engine - robotics

We have a simple robotic model with revolute joins in v-rep. The joints are in force/torque mode, and they are controlled via non-threaded child script using simSetJointTargetVelocity function of the simulator. The collision is enabled in the model, and some toy weights are set to the connecting poles.
The error we have is that the blue part of the joint (the movable part) "wiggles" around and eventually out of the red part of the joint (the fixed case). Here's a screenshot showing the error.
(The blue part of the upper joint should be inside the red part, as is in the lower joint)
How to fix the moving part of the joint so that it doesn't move around, but only rotates as requested by the velocity settings?

What do you mean by "toy weights" ?
You should keep in mind that physical simulations are relatively fragile and that some restrictions apply. In your case, it seems the masses you set are making the simulation behave strangely. Try to keep the mass ratio between linked objects below 1/10.
You can also modify the simulation settings, to increase its precision. You can do that in the simulation settings dialog (http://www.coppeliarobotics.com/helpFiles/) and in the general dynamics properties dialog. You can also try if your simulation works better with another physics engine than bullet (I suggest "Newton").
For more info you should take a look at http://www.coppeliarobotics.com/helpFiles/en/designingDynamicSimulations.htm, especially at the "Design considerations" section.

Related

Variable inflation of obstacles in regards to costmap_2d?

I'm doing a robot navigation and path planning project based on simulating the turtlebot3 and driving with the A* planner.
I'm using a program that allows the robot to plan a route only through 'cells' with no cost value (aka. freespace with an inflation cost of 0). However, adjusting the inflation radius I'm experiencing that the robot either cannot pass through narrow openings when the inflation is higher, but drive along a wall when it is low.
I'm wondering if there is a way to control the inflation or something? My desires outcome is for the robot to drive in the center of wide hallways, not along walls, but be able to pass through doors that it should be able to fit through.
Thank you.
I managed to solve this problem thanks to some advice that made me look outside the box.
The problem was intrinsic to my planner, the fact that allowed space to navigate through was binary (aka. either perfectly allowed to drive through or not allowed).
Instead I changed it so that all space other than the walls were allowed space, and added the cost of a cell (from the cost map) to the cells. That way instead of being binary whether the drive can or can't drive in a cell, both the distance and cost of the cells affect the robots path, making it try to keep away from walls, but able to pass through places of high cost if there's no other way.

Hololens replaces GameObjects after spatialmap scan

I have made an application for the hololens with the holotoolkit. The app gets an array with 3D positions and spawns GameObjects based on these positions.
After walking a bit in the room and change some realworld objects (maybe open a door or something) the hololens will recognized it, then a window opens and says 'Finding your space' and all of the GameObjects are in the wrong position.
How can I use SpaitalMapping, but not allow to replace the GameObjects i place?
After walking a bit in the room and change some realworld objects (maybe open a door or something) the hololens will recognized it
I'm not sure the details of the changes you made on realworld objects, but some changes in the real world may have a great impact on the lighting conditions. For example, after opening an outward door in a dimly lit room. a lot of daylight will enter the room.
Lighting can make a difference in the visual features that HoloLens detects. So changeable lighting conditions might cause HoloLens to lose tracking.
Besides, in environments where the visual features change because most objects move, will also cause the same problem.
I recommend that you try the steps in I see a message that says Finding your space to fix this problem. In short, make sure your artificial lighting conditions and WiFi signal are stable and try moving more slowly.

Unity deferred point lights disappear at distance

Summary including updates:
Unity 5 scene using deferred lighting, containing approximately 200 lights spread along 800 units of space.
Most of the lights are point lights, some are spots - the spots work fine.
The point lights cut instantly to dark at around 150-200 units away from the camera.
If large numbers of point lights are moved inside this range they work without issue.
Switching the Render Priority between Auto and Important makes no difference.
If I play a different scene in the editor which allows me to load this scene, it displays correctly! It still does not display correctly when played directly or when running the build.
I've got a basic scene together, which consists of 5 cloned sections of corridor, each with 12 lights, so 60 total.
However, only the first couple of sections show properly, the others are almost completely dark:
(please be kind, I only started this one today :P)
And from the editor, with the end section highlighted to show the distance better:
As you can faintly see, the lights are actually there, just very, very dim:
When you walk down the corridor, they snap to full brightness as you approach.
This is on a build with deferred lighting set, and the pixel light count turned right up, just in case.
I' guessed this might relate to LOD or camera range in some way, but I can't seem to get anything to effect the issue currently.
(This scene is actually based around the lights cutting out and switching to emergency lighting so I really do need to be able to control them!)
UPDATE
The lights you can see are spot lights. The lights that are disappearing are all point lights.
You can just see the spot lights uplighting onto the ceiling in the distance, but the main ceiling lights just go completely dark.
UPDATE 2
I've added a frankly silly number of lights into the scene and extended the corridor, to run some tests.
There are now 24 lights per section, and a total of 8 sections, making 192 lights in all:
I wanted to check if more lights would cut out, and they don't. It seems to be entirely based around range - around 150-200 units in my scene.
To confirm this, I also walked to the center of the tunnel to see if the number of lights visible would effectively double, including ones behind - they do.
I also moved all of the sections close to the camera to confirmed that all the lights can be displayed at once without problems, and this works as well.
UPDATE 3
I have found a situation where the scene displays correctly!
If I press play in the editor on my main menu scene, then press the UI button that loads this scene, it displays correctly!
It still does not display correctly either when playing the scene directly, or when running the final build.
My solution for this problem is (I'm new, but I found this helped):
Go to quality settings
Search for Pixel Light Count
Raise this number to actual number of your lights in your scene.
This parameter establishes number of sources of light which can be displayed at they same time - I think.

Cloning nodes and performance, geometry, and performance; IOS Scenekit

I'm writing a app using Scenekit where the client wishes to push the limits of animation in IOS. This particular app has requirements where I"m pushing out to the screen over 1,500 redraws. Even with this many redraws, I've locked down the FPS to 60, which is great, but when I add all elements the client wants, the redraws are pushed to 7,500 redraws (and yes, this isn't a mistake or a joke, this is the redraw number even though it's almost 50-80 times more than most redraw times I've seen with scenekit). At this level of redrawing, the screen contains 1.7 million vertices, and around 800k polygons. This is a a lot of stuff, and it's really too much stuff for this app to be useful to anyone because now my FPS drops to 15-30FPS which is expected from drawing over 3K geometry elements on screen. What I've done so far:
I clone all nodes, cloning allows me to push the limits of Scenekit. I was able to fit on screen over 1.5k constant CAAnimations with over 1.8K unique geometries placed in different locations across the screen.
I've forced all windows, views, and screens in app to be opaque by looping through all windows and setting their opaque property to yes.
Question is this, I can deal with the performance issues, but I'm having a problem with the node cloning. Well, the node cloning works, but the problem is that each geometry that is pushed to the screen must have a different size and it seems like there is no way to change the geometry of each separate clone. I know that I can change the geometry of a "copied" node (SCNNode *node = [masterNode copy];), and I know I can change the materials property of a cloned node, but is there a way to change the geometry of the cloned node? Apple doesn't give any insight about the geometry being changed, but they do talk about changing the materials. Am I to assume that I can't change the size of the geometry of the clone? I can change the transform, pivot, rotation, animation, position, etc, of the clone, but the size of the geometry won't change. For my purposes, I just need the "height" variable of a cylinder to be changeable, I have everything else in good order, AND, there's no other way to push over 2k redraws to a screen without node cloning, I've tried it without cloning and FPS drops to less than 10 with just 300 redraws when declaring each geometry and node with geometry as it's own unique variable.
Lastly, given this same scenario, how much of a performance increase should I expect by moving from Scenekit to Metal. I'm not worried about the math, the level of detail, the time consuming operations of setting up the rendering pipeline or whatever else might come my way, I'm merely trying to find the BEST solution for my problem here, and I've not used Metal yet because I'm not sure I'd get different results given how many polygons, vertices, and redraws are required. Thanks.
is there a way to change the geometry of the cloned node
I believe you can change the baked geometry itself, but not the parametric one (not the SCNCylinder). So you can (to change the height):
Scale the node
Change the Transformation Matrix (so scaling too, just a different way to)
Add a Geometry Shader modifier that moves the points up/down on the axis you want
Changing the actual geometry kind of defeats the whole purpose of cloning, so I don't think there is a way around that.
Lastly, given this same scenario, how much of a performance increase should I expect by moving from Scenekit to Metal.
A lot. Around 30% from what I've seen, but again it will depend on your setup. Metal comes with iOS 9, and you won't have to do anything to get it for your scene, so just update one of your devices and try it there, to see if it helps!
Out of curiosity: why do you need so much cylinders? Could you not cheat the way they are rendered?

Creating a "puff of smoke" effect in iOS game

I would like to have some text appear and disappear in a puff of smoke effect in an iPhone game. For example, when someone scores points, I want to show the new points that were added. It should appear in a puff of smoke and disappear within a second or two.
How do I create that?
Have a look at Particle Designer from 71 Squared. It costs about $7.99 and includes easy code generation and integration. There are some pre-configured smoke effects available in the shared library.
http://particledesigner.71squared.com
You will most likely have kind of "cheap" effects using particles, but you'll have a good control over the animation (velocity, scaling, acceleration...).
Another way to go is to use multiple images of smoke and overlay them, then launch an UIView animation with random properties for rotating, scaling and timing.

Resources