I am using ultrasonic sensors to get the data about the indoor environment i.e the distance of the from each wall . I want draw a realtime map of the surronding environment using that can u please guide that which software or which library is best suited for this purpose
Try OpenCV. It has everything you need for image processing. Could be an overkill tho, but I wouldn't mind it.
http://opencv.org/
If you want realtime map, I'd use Labview->embedded MATLAB code / C++. Labview has excellent hardware/peripheral support and operations, and you can embed custom code in the signal flow representation.
If you are using something like arduino or raspberry or any other such electronics kit to capture the ultrasound data, you can send the data to the serial port and then use Matlab to read from that serial port and use it to plot a live map. A good step by step example of how this can be done is available at Matlab Arduino org website
Related
My objective is to use finite horizon linear quadratic regulator(FHLQR) to follow a trajectory generated by a mathematical program and simulate it in Gazebo. As FHLQR needs a system as input, I'm using the QuadrotorPlant, but I'm not sure if this is ideal. My problems arise when I try to connect the state from Gazebo into Drake. In short, what would be the proper way of coupling state from Gazebo with a controller such as FHLQR?
I've thought about editing the context of QuadrotorPlant to mirror the state in Gazebo, but after this update I'm having trouble getting control output from the controller. I've also thought about coupling the Simulator between the output of the controller and input of the QuadrotorPlant, but haven't figured out how to modify the Simulator to mirror Gazebo.
And for your gazebo interface, and assuming you're all in c++, then I'd imagine it will look something like this:
// setup
auto regulator = MakeFiniteHorizonLinearQuadraticRegulator(...);
auto context = regulator.CreateDefaultContext();
// during execution
context->SetTime(time_from_gazebo);
context->FixInputPort(0, Eigen::VectorXd([state obtained from gazebo]));
Eigen::VectorXd u = regulator->get_output_port(0)->Eval(context);
// then apply u to your gazebo interface
I think we should be able to help, but probably need a few more details.
My mental model of your setup is that you use QuadrotorPlant to design the trajectory and the MakeFiniteHorizonLinearQuadraticRegulator methods in drake... the result of that is a drake System that has an input port expecting a vector of doubles representing the state of the quadrotor, and it outputs a vector of doubles that represent the thrust commands for the quadrotor.
Separately, you have a Gazebo simulator with a quadrotor, that is accepts commands and simulates the dynamics.
Are you trying to connect them via message passing (as opposed to a single executable)? Presumably with ROS1 messages? (If yes, then we have little systems in drake that can send/receive ROS messages, which we can point you to)
FWIW, I would definitely recommend trying the workflow with just running an LQR controller in drake before trying the trajectory version.
I am working in a UAV-Team and my task is following and locking another UAV autonomously. I coded my opencv part and I used background substitution method and several filters. I can get absolute result from my code (like to forward go left , go right). My question is how can I send this result to the UAV's motors. How can I communicate with my UAV with C++? I've read lots of documentation from ardupilot, ardurov, opencv and pixhawk. But still couldn't figure it out.
Connect your microprocessor(i.e rasberry Pi) with pixhawk ans use mavlink communication protocols to send command here is link
And you can use dronekit also to do that.
I'm looking into coding a very simple LAN based home monitoring system using python 2.7 on Windows. I have a number of computers around the house each with a usb webcam attached. The cameras have built in microphones. I'm looking for the best way to capture and stream the audio and video over the network, then recieve and view/listen to it. I'm guessing I'd have to use PyAudio to get the audio from the microphone and CV2 to get the video, past that, I'm not sure how I'd stream that data to another computer, recieve it and then view/listen to it.
Not realy a question here, but still I guess I have a solution for you
(but there a millions of ways to solve this.)
My way is ROS (Robot Operating System), which is basically a TCP/IP Service Wrapper. Anyway you can simple broadcast and receive streams via your network.
ROS can be implemented in C++ or Python.
ROS usually applies OpenCV as CV-library, so it should suite your wishes.
Straight forward examples for video are (i.e.) here:
mjpeg_server
web_video_server
Audio streaming is introduced here:
audio_common (there might be solutions via PyAudio. Not sure if other solutions might come more easy and still suitable.)
I am kind of a beginner in programming, learning it in school, so I really don't know much.
But I want to make a program for PC and maybe app for iPhone/Android that receives a video-stream from a camera and displays it, nothing more.
How do I do this in C++/C# in Visual Studio?
Camera -> WiFi -> PC/Phone
A good library for working with images/video in c++ is OpenCV. I would recommend taking a look at their examples.
http://docs.opencv.org/3.0.0/index.html
Check out the highgui module!
You should first check for cameras that come with a programming API so that it is easy to write programs to communicate with it.
If the camera drivers can make it communicate with standard chat apps like Sykpe, you should be able to use C++ and OpenCV to capture a stream from it. But you can choose the language and tools according to what you want to do with the video stream.
We have an "MC1362 Camera" and an "Inspecta-5" frame grabber in our lab. There is program in LABVIEW11 which gets the data from a frame grabber, however as the Labview is slow my supervisor has told me to write a program in c++ to get the data from the frame grabber. I have no idea how to write a c++ program to connect to a frame grabber and do the data acquisition. I know how to write software in c++, but have never tried programming to connect to hardware and read data from it. Is there any specific library or framework which can help me, or any tutorial?
Please, if anybody knows, help me in this matter.
Update:just to add, we are doing medical image analysis, and a laser illuminate a subject, so camera will take pictures and pass it to the computer. I need to grab the pictures and analysis them.
You basically have a couple of options,
1 see if there is an SDK for the grabber card, if there is this is usually easier then option 2 but is of course restricted to work with that grabber or familly of grabber cards, we do it this way with the eurysys grabber cards.
2 assuming you are running on a windows platform, implement a DirectShow filtergraph and write your own ouput filter to get the data, the SDK for DirectShow is quiet good and has many examples. This approach is far more flexible and you should be able to use a number of grabber but its also alot more complex, we do it this way for USB / some other inbuilt grabbers.
Our software is done in Delphi 7 but its just importing DLLs, for C++ should be no problem and most SDK's are written round C++ anyway.
I know its not much but its a place to start.
Update
Just done a quick Google search and there is an SDK for that Grabber and on first looks its seams fairly straight forward.