Robotic arm fall to ground in gazebo - ros

I create a custom URDF in Solidworks and simulate it in ROS when ever I launch the robot in the gazebo simulator the arm fall to the ground. the robot is perfectly fine in rviz.

That is because you are not sending any signals to the joints, so it is behaving as links connected to a movable joint that is not powered. You need to:
Define the joints as fixed joints as
<joint name="footprint" type="fixed" >
<parent link="base_footprint" />
<child link="base_link" />
<origin xyz="0 0 0.05" rpy="0 0 0" />
</joint>
or add a controller to your system as described here.
Follow the Gazebo ROS Control to add those to your system and be able to interact with your joints via the joint_state_publisher topic.

Related

How to add instantaneous force onto drake ball

I'm working on a juggling robot iiwa, and am looking to add disturbances onto the ball every now and then to see how well the controller works. Is there an easy way to add a force/disturbance (e.g. wind) onto the ball?
If it's helpful I'm making the ball using a sdf file.
MultibodyPlant has an applied_spatial_force input port to facilitate exactly this type of application. There are a number of relevant posts:
Applying an external force to an object in pydrake
Applying Propeller and Wing forces to a MultiBodyPlant in Drake

Linear gradients, filters, masks, clip-paths in SVGs not showing in iOS

Background
I've got a somewhat complex gradient needs in my first Ionic4 PWA (thanks to a talented designer who is ALSO new to PWAs).
Many SVG custom icons are calling many different linear-gradient's through fill:url(#the-gradient); throughout our .scss files. Some of these icons have 9 states (grey, 7 colors, rainbow)
Additionally, these gradients use CSS variables in the stops to further customize the gradients based on themes. These gradients are being stored currently in index.html so that all icons can access them.
<svg aria-hidden="true" focusable="false" style="width:0;height:0;position:absolute;">
<defs>
<linearGradient id="default-icon-graydient" x1="0" x2="0" ,="" y1="1" y2="0">
<stop offset="0%" stop-color="var(--gratiu-dark-grey)"/>
<stop offset="100%" stop-color="var(--gratiu-ml-grey)"/>
</linearGradient>
<linearGradient id="select-icon-gradient" x1="0" x2="0" ,="" y1="1" y2="0">
<stop offset="0%" stop-color="var(--gratiu-current-color)"/>
<stop offset="50%" stop-color="var(--gratiu-current-color)"/>
<stop offset="100%" stop-color="var(--gratiu-next-color)"/>
</linearGradient>
<!--and many, many more...-->
</defs>
</svg>
This system works perfectly on android and on desktop - on iOS however, whether safari or chrome, the icons do not appear.
Things I've tried:
First I added a backup solid color to the fills eg. fill:
url(#select-icon-gradient) var(--gratiu-current-color); this works to keep it functional,
but these gradients are vital bits of information for our users and
they need to be able to see them, not just flat colors
I then tried absolutely linking to the index.html fill: url('http://localhost:8100/index.html#select-icon-gradient'); but this didn't work anywhere
I then tried storing the SVG code in an external SVG, and linking to that absolutely fill: url('http://localhost:8100/app/assets/img/gradients.svg#select-icon-gradient'); still didn't work
I tried moving the gradients back into each SVG file rather than linking to an external files for them Still didn't work.
I thought I was really smart, when I made divs with CSS gradients in their background property, but when it came time to call a path to use for clip-path: url(#the-path), I ran into the same problem as the gradients themselves. Absolutely linking didn't work. Having the clipPath AND the CSS inline on the same page as the icon worked on desktop, but not iOS.
As an aside, I also noticed during this process the same issue with applying an SVG filter (drop shadow). I was able to locate a work around where I can use a containing div and apply a CSS filter on it...but it's not ideal.
The current options I feel I have are:
Replace every single icon style ever with PNGs and use switch cases and if statements to call the appropriate ones which will need to change on the fly.
Create a single SVG for each icon with a rasterized version of each gradient, use CSS to show/hide each individual image.
Obviously a single PNG is lighter weight than a big ol stuffed SVG...but the benefit to the SVG is it would load once and be done with it.
To the questions:
Is there something I haven't tried yet? Anything I've overlooked?
Are SVGs or PNGs better in PWAs anyway?
Why is this so flipping hard?

How to insert object without using any marker in ar.js

Is it possible to add object on the floor(or any surface) without using marker in ar.js?
I wonder if there is a tool to detect the floor and then I can trigger an object to it! So far it is possible using a marker image like this:
<!doctype HTML>
<html>
<script src="https://aframe.io/releases/0.6.1/aframe.min.js"></script>
<script src="https://cdn.rawgit.com/jeromeetienne/AR.js/1.5.0/aframe/build/aframe-ar.js"> </script>
<body style='margin : 0px; overflow: hidden;'>
<a-scene embedded arjs>
<a-marker preset="hiro">
<a-box position='0 0.5 0' material='color: black;'></a-box>
</a-marker>
<a-entity camera></a-entity>
</a-scene>
</body>
</html>
Simple answer: No, AR.js is strictly for marker based AR. The location of the marker is how AR.js finds out where the "plane" is that it can use to put stuff on, and the size of the marker defines how big stuff should be shown (try to show the marker in a website, then zoom in and out to see your objects change size).
A bit more complicated answer: But there were a few experiments with Tango devices from Google (now called ARCore I think) some time ago, that gave AR.js some information about the floor and other surfaces. You can still find parts of that in the repository of AR.js.
There is a commercial product, "8thwall web" (I have no relationship to them besides that I have tested their product myself.), that offers web based surface detection. But it only uses Aframe directly, and not AR.js - so I am not sure if that is what you are looking for. But surely worth a look.

Revolute joints jump out of frame - vrep, bullet engine

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.

Network Game - Interpolation/extrapolation with SpriteKit

I'm currently facing a - I think - very common networking problem. But I can't find an answer with SpriteKit.
Let's take a simulation with a ball that bounce again wall. The objective is to synch the ball position on two devices via bluetooth or Wifi.
It uses SpriteKit physics to simulate ball movement and collisions
It uses MultipeerConnectivity for networking on bluetooth or Wifi.
The Device A - master - simulates everything and tells ball position and vector to Device B at synchronisation points. The Device B simulates the scene between synch points.
Currently, the ball in Device B is always ~50ms later than device A. To prevent this, someone told me about "interpolation" : Device B receive the DeviceA's ball position and knows the info is 50ms old. So Device B should be able to predict the "real" position 50ms after the received one.
But I did not find a way to do this with SpriteKit. I don't want to manually develop what's SpriteKit physics automatically made for me!
I'm just searching for a way to simulate a 50ms jump in the future!
Any idea?
You can experiment with speed property of your SKScene. It can set above 1.0.

Resources