ROS2 in google cloud robotics - google-cloud-robotics

I would like to ask if it is possible to use or has the ros2 already been used with cloud robotics?
I am currently developing a project using cloud robotics, and one of the goals is to use ros2 to send orders to the robot.
My question is how to send orders to the robot remotely using ros2 in k8s.
If someone can give me some reference it would be helpful.

If you specifically want to use ROS2 to communicate between the cloud and the robot, I'm afraid it won't help. You could consider using a declarative API to reliably send orders from the cloud to the robot. You'd need to:
create a custom resource definition (CRD) to represent your orders
send orders from the cloud by creating a custom resource
create a controller on the robot, which looks at the orders and executes them
There's more detail in the declarative API tutorial.
If you want to avoid this indirection and use ROS2, this ROS forum post suggests using a VPN that can forward multicast traffic.

Related

List all the scheduled snapshots in a given project and region programmatically (golang)

I am trying to use a golang client to programmatically list all the scheduled snapshot policies in a given project and region and describe them.
I am able to fetch them using gcloud commands, but wondering how I can do the same programmatically (preferably compute golang client)?
gcloud compute resource-policies list --project myproject
gcloud compute resource-policies describe my-snapshot-policy --project myproject --region myregion
thanks in advance.
Per #john-hanley, you are encouraged to demonstrate your own attempt to solve the problem in your question.
Google provides SDKs for all of its services. There are 2 flavors and this can be confusing. The original style which you can find for any Google service are called API Client Libraries. For Google Cloud Platform many (!) of the services also (!) have Cloud Client Libraries. See Google Client Libraries Explained.
For Compute for Golang, there's a new Cloud Client Library.
You can see examples of its use here. I encourage you to follow Google's style including by using Application Default Credentials.
You will want to use a ResourcePoliciesClient and the client's Get and List methods.

What are Istio alternative for Authentication Policy and what is Istio flow for development?

At this url you can have a look at my project jut to have some context:
https://github.com/Deviad/clarity/tree/feature/hyperledger
Long story short I am building an open source framework for building Escrows that can take advantage of the latest PSD2 https://www.openbankingtracker.com/
It support Cryptocurrency payments and implements some sort of side chain in order to have a proof that a contract was signed.
Basically of all of the things that Istio does what I really need is the Authentication Policy using JWT.
This in order to avoid writing this part in every microservice that I am creating.
Of course the gateway is also something important.
The main issue is that I have no idea while I am developing using my IDE (Intellij IDEA) what I can do in order to avoid having to stop, rebuild and start containers every single time I need to rebuild since once I use Istio, I will need to use Istio also in development, otherwise I would have to write some dummy services that fake the authorization from istio when I want to check if a certain user has the permissions to access a resource.
What possibilities I have to have a lean workflow with Istio and eventually what alternatives to Istio do I have?
As for the workflow part of my question, I have found a possible solution:
https://garden.io
There is a nice workshop available here:
https://www.youtube.com/watch?v=Xfi9XqcZ76M

Regarding Events of APIs generated by hyperledger composer rest server

I am working on a POC and do not want to write any specific transaction processing functions. Created assets, participants etc. and all, so the model is ready. Generated rest api using hyperledger composer-rest-server. The frontend is developed in simple html/javascript.
the problem is that i need events also available whenver i CRUD using composer generated APIs, but not able to figure out how.
IS it that to capture events, we need to create assets using transaction processing functions only and not via composer rest server apis - a little novice kinda question but i am stuck in this thought.
regards,
Sophia
I think you have figured it by now, but here's the answer for the rest of us: you can only generate events from your chaincode, and every event has to be described in your model.

What is the recommended way to invoke and query data/transactions that were modeled using Fabric Composer?

I am building an PoC using Fabric v0.6 and composer-ui. The question I have is regarding how to interact with the Fabric peers once I have deployed my .bna file in the Fabric network. In the past I have made invoke and query calls to my chaincode using gRPC and passing the function name and arguments through the call. In the case of chaincode deployed through composer, there is a whole abstraction happening so I am not sure if the name of my transactions created in composer translate exactly to names I can call via my gRPC calls on the client side (my node application). I also don't know if the arguments that I pass to the chaincode are the same or if any special argument is expected.
So I guess my question is, from the client side, how do I make calls to transactions in my chaincode that have been creating using Composer? Are there client examples out there for Fabric v0.6? Thanks!
The first example that comes to mind is the sample-applications repository at https://github.com/fabric-composer/sample-applications
if you look in the sample-applications/packages/getting-started there is an example of a client application. The landRegistry.js file in the lib directory contains the bulk of the code used to interact with the business network.
There is also an application generator which is described in more detail at
https://fabric-composer.github.io/applications/genapp.html
You can also find reference documentation for both client side and businessnetwork implementations at
https://fabric-composer.github.io/jsdoc/
You should also consider using the REST API that Composer can generate for your business network.
npm install -g composer-rest-server
composer-rest-server
Then fill in the details required to connect to your business network and the composer-rest-server will expose a Swagger defined REST API that you can exercise using Swagger UI. The REST API is expressed in terms of the assets, participants and transactions that are modeled in your business network.
More docs here:
https://fabric-composer.github.io/integrating/getting-started-rest-api.html
The advantage of using the REST API is that it keeps the coupling between the client application and the blockchain loose; the client doesn't need any Composer libraries and doesn't even need to know that the data source is a blockchain.

How to create a Firewall rule for Compute Engine via Google Cloud Client?

I am currently using the Java Google Cloud Client for Compute Engine. I was able to successfully create a Network. Is it possible to programatically create a new firewall rule (given source, protocol, port, tags, etc)? It seems this is possible using gcloud command line, but I'd like to know how to do this via API. I've looked through all of the documentation but can't seem to find anything related to this. In addition, how can I tie the firewall rule to a specific Network? Thanks!
Sure, see the API reference, at the bottom it has examples for a variety of languages:
https://cloud.google.com/compute/docs/reference/latest/firewalls/insert
Note that if we can do something with gcloud, we can always do it with REST API (and its language bindings), gcloud is just a command line wrapper for the API. If you add --log-http flag in the command, it will show you the HTTP details.

Resources