Search Results

Search found 347 results on 14 pages for 'robot'.

Page 4/14 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Where will the image be saved? [closed]

    - by Dummy Derp
    import java.awt.Dimension; import java.awt.Rectangle; import java.awt.Robot; import java.awt.Toolkit; import java.awt.image.BufferedImage; import javax.imageio.ImageIO; import java.io.File; ... public void captureScreen(String fileName) throws Exception { Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Rectangle screenRectangle = new Rectangle(screenSize); Robot robot = new Robot(); BufferedImage image = robot.createScreenCapture(screenRectangle); ImageIO.write(image, "png", new File(fileName)); } ... Going over this code I found on the internet. I got everything except the part where file is created. In what format file name should be? Should it be C:/myFolder/myImage.png" or just myImage.png and where will it be saved? Here is what docs say: File public File(String pathname) Creates a new File instance by converting the given pathname string into an abstract pathname. If the given string is the empty string, then the result is the empty abstract pathname. Parameters: pathname - A pathname string Throws: NullPointerException - If the pathname argument is null

    Read the article

  • How to make new file permission inherit from the parent directory?

    - by Wai Yip Tung
    I have a directory called data. Then I am running a script under the user id 'robot'. robot writes to the data directory and update files inside. The idea is data is open for both me and robot to update. So I setup the permission and owner group like this drwxrwxr-x 2 me robot-grp 4096 Jun 11 20:50 data where both me and robot belongs to the 'robot-grp'. I change the permission and the owner group recursively like the parent directory. I regularly upload new files into the data directory using rsync. Unfortunately, new files uploaded does not inherit the parent directory's permission as I hope. Instead it looks like this -rw-r--r-- 1 me users 6 Jun 11 20:50 new-file.txt When robot tries to update new-file.txt, it fails due to lack of file permission. I'm not sure if setting umask helps. In anycase the new files does not really follow it. $ umask -S u=rwx,g=rx,o=rx I'm often confounded by Unix file permission. Do I even have a right plan? I'm using Debian lenny.

    Read the article

  • Help with create action in a different show page

    - by Andrew
    Hi, I'm a Rails newbie and want to do something but keep messing something up. I'd love some help. I have a simple app that has three tables. Users, Robots, and Recipients. Robots belong_to users and Recipients belong_to robots. On the robot show page, I want to be able to create recipients for that robot right within the robot show page. I have the following code in the robot show page which lists current recipients: <table> <% @robot.recipients.each do |recipient| %> <tr> <td><b><%=h recipient.chat_screen_name %></b> via <%=h recipient.protocol_name</td> <td><%= link_to 'Edit', edit_recipient_path(recipient) %>&nbsp;</td> <td><%= link_to 'Delete', recipient, :confirm => 'Are you sure?', :method => :delete %></td> </tr> <% end %> </table> What I'd like to do is have an empty field in which the user can add a new recipient, and have tried the following: I added this to the Robots Show view: <% form_for(@robot.recipient) do |f| %> Enter the screen name<br> <%= f.text_field :chat_screen_name %> <p> <%= f.submit 'Update' %> </p> <% end %> and then this to the Robot controller in the show action: @recipient = Recipient.new @recipients = Recipient.all Alas, I'm still getting a NoMethod error that says: "undefined method `recipient' for #" I'm not sure what I'm missing. Any help would be greatly appreciated. Thank you.

    Read the article

  • Binding the selected value from a combobox to a member of a class.

    - by CM
    I have a combobox that is bound to a an instance of a class. I need to get the user's selection ID of the combobox and set a class property equal to it. For example, here is the class: public class robot { private string _ID; private string _name; private string _configFile; [XmlElement("hardware")] public hardware[] hardware; public string ID { get { return _ID; } set { _ID = value; } } public string name { get { return _name; } set { _name = value; } } public string configFile { get { return _configFile; } set { _configFile = value; } } } Now here is the code to bind the combobox to an instance of that class. This display's the name of each robot in the array in the combobox. private void SetupDevicesComboBox() { robot[] robot = CommConfig.robot; cmbDevices.DataSource = robot; cmbDevices.DisplayMember = "name"; cmbDevices.ValueMember = "ID"; } But now I can't seem to take what the user selects and use it. How do I use the "ID" of what the user select's from the combobox? Settings.selectedRobotID = cmbDevices.ValueMember; //This just generates "ID" regardless of what is selected. I also tried Settings.selectedRobotID = cmbDevices.SelectedItem.ToString(); //This just generates "CommConfig.robot" Thanks

    Read the article

  • How to capture a screen shot in .NET from a webapplication?

    - by CodeToGlory
    In Java we can do it as follows: import java.awt.Dimension; import java.awt.Rectangle; import java.awt.Robot; import java.awt.Toolkit; import java.awt.image.BufferedImage; import javax.imageio.ImageIO; import java.io.File; ... public void captureScreen(String fileName) throws Exception { Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Rectangle screenRectangle = new Rectangle(screenSize); Robot robot = new Robot(); BufferedImage image = robot.createScreenCapture(screenRectangle); ImageIO.write(image, "png", new File(fileName)); } ... How do we do this in .NET from a webapplication? Capturing the client's screen and sending it to the server all from within the application.

    Read the article

  • argv Memory Allocation

    - by Joshua Green
    I was wondering if someone could tell me what I am doing wrong that I get this Unhandled Exception error message: 0xC0000005: Access violation reading location 0x0000000c. with a green pointer pointing at my first Prolog code (fid_t): Here is my header file: class UserTaskProlog { public: UserTaskProlog( ArRobot* r ); ~UserTaskProlog( ); protected: int cycles; char* argv[ 1 ]; term_t tf; term_t tx; term_t goal_term; functor_t goal_functor; ArRobot* robot; void logTask( ); }; And here is my main code: UserTaskProlog::UserTaskProlog( ArRobot* r ) : robot( r ), robotTaskFunc( this, &UserTaskProlog::logTask ) { cycles = 0; argv[ 0 ] = "libpl.dll"; argv[ 1 ] = NULL; PL_initialise( 1, argv ); PlCall( "consult( 'myPrologFile.pl' )" ); robot->addSensorInterpTask( "UserTaskProlog", 50, &robotTaskFunc ); } UserTaskProlog::~UserTaskProlog( ) { robot->remSensorInterpTask( &robotTaskFunc ); } void UserTaskProlog::logTask( ) { cycles++; fid_t fid = PL_open_foreign_frame( ); tf = PL_new_term_ref( ); PL_put_integer( tf, 5 ); tx = PL_new_term_ref( ); goal_term = PL_new_term_ref( ); goal_functor = PL_new_functor( PL_new_atom( "factorial" ), 2 ); PL_cons_functor( goal_term, goal_functor, tf, tx ); int fact; if ( PL_call( goal_term, NULL ) ) { PL_get_integer( tx, &fact ); cout << fact << endl; } PL_discard_foreign_frame( fid ); } int main( int argc, char** argv ) { ArRobot robot; ArArgumentParser argParser( &argc, argv ); UserTaskProlog talk( &robot ); } Thank you,

    Read the article

  • Can someone find me a reference to this quote?

    - by Robot
    I'm looking for a reasonable reference to a known software personality who said something along the lines "make sure your software runs the most common cases fast/easy but all cases are possible". I'm sure there are many 80/20 quotes, so I'm looking for the most famous that gets that point across. -Robot

    Read the article

  • SteelSeries & JavaFX External Control via Tinkerforge

    - by Geertjan
    The first photo shows me controling a JavaFX chart by rotating a Tinkerforge device, while the other two are of me using code by Christian Pohl from Nordhorn, Germany, to show components from Gerrit Grunwald's SteelSeries library being externally controled by Tinkerforge devices: What these examples show is that you can have a robot (i.e., an external device), of some kind, that can produce output that can be visualized via JavaFX charts and SteelSeries components. For example, imagine a robot that moves around while collecting data on the current temperature throughout a building. That's possible because a temperature device is part of Tinkerforge, just like the rotating device and distance device shown in the photos above. The temperature data collected by the robot would be displayed in various ways on a computer via, for example, JavaFX charts and SteelSeries components. From there, reports could be produced and adjustments could be made to the robot while it continues moving around collecting temperature data. The fact that Tinkerforge has Wifi support makes a scenario such as described here completely possible to implement. And all of this can be programmed in Java, without very much work, since the Java bindings for Tinkerforge are simple to use, such as shown in yesterday's blog entry.

    Read the article

  • Which Graphics/Geometry abstraction to choose?

    - by Robz
    I've been thinking about the design for a browser app on the HTML5 canvas that simulates a 2D robot zooming around, sensing the world around it. I decided to do this from scratch just for fun. I need shapes, like polygons, circles, and lines in order to model the robot and the world it lives in. These shapes need to be drawn with different appearance attributes, like border/fill style/width/color. I also need to have geometry functions to detect intersections and containment for the robot's sensors and so that the robot doesn't go inside stuff. One idea for functions is to have two totally separate libraries, one to implement graphics (like drawShape(context, shape)) and one for geometry operations (like shapeIntersectsShape(shape1, shape2)). Or, in a more object-oriented approach, the shape objects themselves could implement methods to do their own graphics (shape.draw(context)) and geometry operations (shape1.intersects(shape2)). Then there is the data itself: whether the data to draw a shape and the data to do geometric operations on that shape should be encapsulated within the same object, or be separate structures (where one would contain the other, or both be contained inside another structure). How do existing applications that do graphics/geometry stuff deal with this? Is there one model that is best, or is each good for certain applications? Should the fact that I'm using Javascript instead of a more classical language change how I approach the design?

    Read the article

  • Camera Projection back Into 3D world, offset error

    - by Anthony
    I'm using XNA to simulate a robot in a 3D world and then do image analysis on what the camera sees. I have my camera looking down in front of the direction that the robot is going, and I have the robot detecting white pixels. I'm trying to take the white pixels that it finds and project them back into the 3D world so that I can see if it is actually detecting the correct pixels. I almost have it working, but there is an offset between where the white is in in the World and were I put my orange triangles (which represent what the robot things is white). /// <summary> /// Takes a bool map of and makes vertex positions based on the map. /// </summary> /// <param name="c"> The bool map</param> private void ProjectBoolMapOnGroundAnthony2(bool[,] c) { float triangleSize = 0.04f; // Point of interest in World W cordinate system. Vector3 pointOfInterest_W = Vector3.Zero; // Point of interest in Robot Cordinate system R Vector3 pointOfInterest_R = Vector3.Zero; // alpha is the angle from the robot camera to where it is looking in the center. //double alpha = Math.Atan(1.8f / 1); /// Matrix representation of the view determined by the position, target, and updirection. Matrix View = ((SimulationMain)Game).mainRobot.robotCameraView.View; /// Matrix representation of the view determined by the angle of the field of view (Pi/4), aspectRatio, nearest plane visible (1), and farthest plane visible (1200) Matrix Projection = ((SimulationMain)Game).mainRobot.robotCameraView.Projection; /// Matrix representing how the real world cordinates differ from that of the rendering by the camera. Matrix World = ((SimulationMain)Game).mainRobot.robotCameraView.World; Plane groundPlan = new Plane(Vector3.UnitZ, 0.0f); for (int x = 0; x < this.screenWidth; x++) { for (int y = 0; y < this.screenHeight; ) { if (c[x, y] == true && this.count1D < 62000) { int j = 1; Vector3 nearPlanePoint = Game.GraphicsDevice.Viewport.Unproject(new Vector3(x, y, 0), Projection, View, World); Vector3 farPlanePoint = Game.GraphicsDevice.Viewport.Unproject(new Vector3(x, y, 1), Projection, View, World); //Vector3 pointOfInterest_W = Vector3.in Ray ray = new Ray(nearPlanePoint, farPlanePoint); pointOfInterest_W = ray.Position + ray.Direction * (float) ray.Intersects(groundPlan); this.vertexArray2[this.count1D + 0].Position.X = pointOfInterest_W.X - triangleSize; this.vertexArray2[this.count1D + 0].Position.Y = pointOfInterest_W.Y - triangleSize * j; this.vertexArray2[this.count1D + 0].Position.Z = pointOfInterest_W.Z; this.vertexArray2[this.count1D + 0].Color = Color.DarkOrange; // Put another vertex a the position but +1 in the X direction triangleSize //this.vertexArray2[this.count1D + 1].Position.X = pointOnGroud.X + 3; //this.vertexArray2[this.count1D + 1].Position.Y = pointOnGroud.Y + j; this.vertexArray2[this.count1D + 1].Position.X = pointOfInterest_W.X; this.vertexArray2[this.count1D + 1].Position.Y = pointOfInterest_W.Y + triangleSize * j; this.vertexArray2[this.count1D + 1].Position.Z = pointOfInterest_W.Z; this.vertexArray2[this.count1D + 1].Color = Color.Red; // Put another vertex a the position but +1 in the X direction //this.vertexArray2[this.count1D + 0].Position.X = pointOnGroud.X; //this.vertexArray2[this.count1D + 0].Position.Y = pointOnGroud.Y + 3 + j; this.vertexArray2[this.count1D + 2].Position.X = pointOfInterest_W.X + triangleSize; this.vertexArray2[this.count1D + 2].Position.Y = pointOfInterest_W.Y - triangleSize * j; this.vertexArray2[this.count1D + 2].Position.Z = pointOfInterest_W.Z; this.vertexArray2[this.count1D + 2].Color = Color.Orange; this.count1D += 3; y += j; } else { y++; } } } } The world is a grass texture with lines on it. The world plane is normal at (0,0,1). Any ideas on why there is an offset? Any Ideas? Thanks for the help, Anthony G.

    Read the article

  • Little Wheel Is An Atmospheric and Engaging Point-and-Click Adventure

    - by Jason Fitzpatrick
    If you’re a fan of the resurgence of highly stylized and atmospheric adventure games–such as Spirit, World of Goo, and the like–you’ll definitely want to check out this well executed, free, and more than a little bit charming browser-based game. Little Wheel is set in a world of robots where, 10,000 years ago, a terrible accident at the central power plant left all the robots without power. The entire robot world went into a deep sleep and now, thanks to a freak lightning strike, one little robot has woken up. Your job, as that little robot, is to navigate the world of Little Wheel and help bring it back to life. Hit up the link below to play the game for free–the quality of the visual and audio design make going full screen and turning the speakers on a must. Little Wheel [via Freeware Genuis] How to Make Your Laptop Choose a Wired Connection Instead of Wireless HTG Explains: What Is Two-Factor Authentication and Should I Be Using It? HTG Explains: What Is Windows RT and What Does It Mean To Me?

    Read the article

  • Which token from a long User-Agent should I use in robots.txt?

    - by Gaia
    The definition of User-Agent states that several tokens can be included, as deemed necessary by the client. I want to block certain bots via robots.txt and I am confused as to which part of the User-Agent string to use, especially for more obscure bots. For example: Mozilla/5.0 (compatible; uMBot-LN/1.0; mailto: [email protected])" JS-Kit URL Resolver, http://js-kit.com/ Mozilla/5.0 (compatible; SEOkicks-Robot +http://www.seokicks.de/robot.html Do I use the second token? Can tokens contain spaces, or did the SEOkicks folks forget a semicolon after SEOkicks-Robot? I don't actually intend on making my question specific to a couple bots - I want to know the guideline: which part of UA do I place in robots.txt for these exotic bots with UA as long as a haiku? User-agent: uMBot-LN/1.0 Disallow: / PS: Thank you but I do not need to hear that undesirable bots are better blocked with mod_security. I already have commercial mod_sec rules in place.

    Read the article

  • How to add an account to Entourage that's only a mail forward?

    - by Robot
    I have two email accounts, one is my main account, and the other just forwards to the main. I'd like to select either address from the From: dropdown list, but I think the forward would need to be formal Entourage account for that to work. If I add the forward acct, it insists on trying to login, even though there is no real mailbox for it... it's just a forward. This happens even if I don't check the "Include this account in my Send & Receive All Schedule" checkbox. Is there any way to prevent login attempts, or to add From: addresses without adding them as real mailbox accounts? -Robot

    Read the article

  • delete pointer to 2d array c ++

    - by user1848054
    i have this pointer to 2d array of Robot class Robot ***rob; and this is here the code for the constructor !! and the program works fine !!! but now i am trying to build a destructor to delete this pointer !! and it keeps on crashing the program !! my question is , how to delete this pointer to 2d array of robots ? RobotsWorld::RobotsWorld(int x , int y) { X=x;Y=y; // returns the limitation of the matrix rob = new Robot**[x]; for(int i = 0; i < x; i++) { rob[i] = new Robot*[y]; for(int j = 0; j < y; j++) { rob[i][j] = NULL; } } }

    Read the article

  • Maze Navigation in Player Stage with Roomba

    - by Scott
    Here is my code: /* Scott Landau Robot Lab Assignment 1 */ // Standard Java Libs import java.io.*; // Player/Stage Libs import javaclient2.*; import javaclient2.structures.*; import javaclient2.structures.sonar.*; // Begin public class SpinningRobot { public static Position2DInterface pos = null; public static LaserInterface laser = null; public static void main(String[] args) { PlayerClient robot = new PlayerClient("localhost", 6665); laser = robot.requestInterfaceLaser(0, PlayerConstants.PLAYER_OPEN_MODE); pos = robot.requestInterfacePosition2D(0,PlayerConstants.PLAYER_OPEN_MODE); robot.runThreaded (-1, -1); pos.setSpeed(0.5f, -0.25f); // end pos float x, y; x = 46.0f; y = -46.0f; boolean done = false; while( !done ){ if(laser.isDataReady()) { float[] laser_data = laser.getData().getRanges(); System.out.println("== IR Sensor =="); System.out.println("Left Wall Distance: "+laser_data[360]); System.out.println("Right Wall Distance: " +laser_data[0]); // if laser doesn't reach left wall, move to detect it // so we can guide using left wall if ( laser_data[360] < 0.6f ) { while ( laser_data[360] < 0.6f ) { pos.setSpeed(0.5f, -0.5f); } } else if ( laser_data[0] < 0.6f ) { while(laser_data[0<0.6f) { pos.setSpeed(0.5f, 0.5f); } } pos.setSpeed(0.5f, -0.25f); // end pos? done = ( (pos.getX() == x) && (pos.getY() == y) ); } } } } // End I was trying to have the Roomba go continuously at a slight right curve, quickly turning away from each wall it came to close to if it recognized it with it's laser. I can only use laser_data[360] and laser_data[0] for this one robot. I think this would eventually navigate the maze. However, I am using the Player Stage platform, and Stage freezes when the Roomba comes close to a wall using this code, I have no idea why. Also, if you can think of a better maze navigation algorithm, please let me know. Thank you!

    Read the article

  • Blender mesh mirroring screws up normals when importing in Unity

    - by Shivan Dragon
    My issue is as follows: I've modeled a robot in Blender 2.6. It's a mech-like biped or if you prefer, it kindda looks like a chicken. Since it's symmetrical on the XZ plane, I've decided to mirror some of its parts instead of re-modeling them. Problem is, those mirrored meshes look fine in Blender (faces all show up properly and light falls on them as it should) but in Unity faces and lighting on those very same mirrored meshes is wrong. What also stumps me is the fact that even if I flip normals in Blender, I still get bad results in Unity for those meshes (though now I get different bad results than before). Here's the details: Here's a Blender screen shot of the robot. I've took 2 pictures and slightly rotated the camera around so the geometry in question can be clearly seen: Now, the selected cog-wheel-like piece is the mirrored mesh obtained from mirroring the other cog-wheel on the other (far) side of the robot torso. The back-face culling is turned of here, so it's actually showing the faces as dictated by their normals. As you can see it looks ok, faces are orientated correctly and light falls on it ok (as it does on the original cog-wheel from which it was mirrored). Now if I export this as fbx using the following settings: and then import it into Unity, it looks all screwy: It looks like the normals are in the wrong direction. This is already very strange, because, while in Blender, the original cog-wheel and its mirrored counter part both had normals facing one way, when importing this in Unity, the original cog-wheel still looks ok (like in Blender) but the mirrored one now has normals inverted. First thing I've tried is to go "ok, so I'll flip normals in Blender for the mirrored cog-wheel and then it'll display ok in Unity and that's that". So I went back to Blender, flipped the normals on that mesh, so now it looks bad in Blender: and then re-exported as fbx with the same settings as before, and re-imported into Unity. Sure enough the cog-wheel now looks ok in Unity, in the sense where the faces show up properly, but if you look closely you'll notice that light and shadows are now wrong: Now in Unity, even though the light comes from the back of the robot, the cog-wheel in question acts as if light was coming from some-where else, its faces which should be in shadow are lit up, and those that should be lit up are dark. Here's some things I've tried and which didn't do anything: in Blender I tried mirroring the mesh in 2 ways: first by using the scale to -1 trick, then by using the mirroring tool (select mesh, hit crtl-m, select mirror axis), both ways yield the exact same result in Unity I've tried playing around with the prefab import settings like "normals: import/calculate", "tangents: import/calculate" I've also tired not exporting as fbx manually from Blender, but just dropping the .blend file in the assets folder inside the Unity project So, my question is: is there a way to actually mirror a mesh in Blender and then have it imported in Unity so that it displays properly (as it does in Blender)? If yes, how? Thank you, and please excuse the TL;DR style.

    Read the article

  • 4 Secrets to Get Top Google Ranks Quickly

    Putting all the hype and talk about Google to the site, at the end of the day this search engine is just a giant robot... and like any automated robot, it can be manipulated to get your site to the top. Here are 4 of the best-kept secrets for getting top Google ranks quickly:

    Read the article

  • Need to center image in web page via CSS

    - by Robot
    I'd like to center an image in a page both vertically and horizontally even when the browser is resized. Currently, I use this CSS: .centeredImage { position: fixed; top: 50%; left: 50%; margin-top: -50px; margin-left: -150px; } And this HTML: <img class="centeredImage" src="images/logo.png"> It centers in FF but not IE (image center is placed at upper left corner). Any ideas? -Robot

    Read the article

  • ARP replies contain wrong MAC address

    - by Jayen
    I've got a robot running linux with wired and wireless adapters. When I boot up, it connects to the wireless fine. When I assign an IP to the wired (either statically or with DHCP), it looks like it works. As in, ifconfig shows a proper IP and route shows proper routes. However, when I do an ARP request of the wired IP, the ARP reply contains the wireless MAC. ??? There's no bridge running on the robot, so why don't I get the wired MAC??? When the wire is disconnected, the wired IP replies to ping... Why is the robot replying over the wireless interface to IP requests on the wired???

    Read the article

  • Ignoring Robots - Or Better Yet, Counting Them Separately

    - by [email protected]
    It is quite common to have web sessions that are undesirable from the point of view of analytics. For example, when there are either internal or external robots that check the site's health, index it or just extract information from it. These robotic session do not behave like humans and if their volume is high enough they can sway the statistics and models.One easy way to deal with these sessions is to define a partitioning variable for all the models that is a flag indicating whether the session is "Normal" or "Robot". Then all the reports and the predictions can use the "Normal" partition, while the counts and statistics for Robots are still available.In order for this to work, though, it is necessary to have two conditions:1. It is possible to identify the Robotic sessions.2. No learning happens before the identification of the session as a robot.The first point is obvious, but the second may require some explanation. While the default in RTD is to learn at the end of the session, it is possible to learn in any entry point. This is a setting for each model. There are various reasons to learn in a specific entry point, for example if there is a desire to capture exactly and precisely the data in the session at the time the event happened as opposed to including changes to the end of the session.In any case, if RTD has already learned on the session before the identification of a robot was done there is no way to retract this learning.Identifying the robotic sessions can be done through the use of rules and heuristics. For example we may use some of the following:Maintain a list of known robotic IPs or domainsDetect very long sessions, lasting more than a few hours or visiting more than 500 pagesDetect "robotic" behaviors like a methodic click on all the link of every pageDetect a session with 10 pages clicked at exactly 20 second intervalsDetect extensive non-linear navigationNow, an interesting experiment would be to use the flag above as an output of a model to see if there are more subtle characteristics of robots such that a model can be used to detect robots, even if they fall through the cracks of rules and heuristics.In any case, the basic and simple technique of partitioning the models by the type of session is simple to implement and provides a lot of advantages.

    Read the article

  • Jumping with Mecanim synchronization

    - by Abhishek Deb
    I am using Unity3D 4.1 for one of my projects. I have a robot character which is always running. I am using mecanim animation system. What I really want:When I press Space bar, the character should jump up in the air, triggering an animation clip and then by the time it reaches the ground, the animation clip should also end. What actually is happening:When I press Space bar, the character jumps in the air. Animation clip plays as it should, but ends way before it reaches the ground. So, it looks like he is running in the mid air. What have I done: I have this humanoid robot setup with a jump animation bounded with the space bar key. Also, instead of using root motion, I am directly moving the robot from code. //Jumping if(Input.GetKeyDown(KeyCode.Space)){ rigidbody.AddForce(Vector3.up*jumpVelocty); anim.SetBool("Jump",true); } else anim.SetBool("Jump",false); Character's Details: Rigidbody = Mass:30, Freeze rotaion:x,y,z Capsule Collider = Material: metal, center(0,4.5,0), radius:1, height:11 Script = jumpVelocity:20000 Jump Animation Clip: ~ 2 seconds. I am really out of ideas how to synchronize everything. Should I make the character jump in some other way so that it quickly comes down and touches the ground to match the animation clip? If yes, please provide a direction.

    Read the article

  • Algorithm for detecting windows in a room

    - by user2733436
    I am dealing with the following problem and i was looking to write a Pseudo-code for developing an algorithm that can be generic for such a problem. Here is what i have come up with thus far. STEP 1 In this step i try to get the robot where it maybe placed to the top left corner. Turn Left - If no window or Wall detected keep going forward 1 unit.. if window or wall detected -Turn right -- if no window or Wall detected keep going forward.. if window or wall detected then top left corner is reached. STEP 2 (We start counting windows after we get to this stage to avoid miscounting) I would like to declare a variable called turns as it will help me keep track if robot has gone around entire room. Turns = 4; Now we are facing north and placed on top left corner. while(turns0){ If window or wall detected (if window count++) Turn Right Turn--; While(detection!=wall || detection!=window){ move 1 unit forward Turn left (if window count++) Turn right } } I believe in doing so the robot will go around the entire room and count windows and it will stop once it has gone around the entire room as the turns get decremented. I don't feel this is the best solution and would appreciate suggestions on how i can improve my Pseudo-code. I am not looking for any code just a algorithm on solving such a problem and that is why i have not posted this in stack overflow. I apologize if my Pseudo-code is poorly written please make suggestions if i can improve that as i am new to this. Thanks.

    Read the article

  • Calculating rotation and translation matrices between two odometry positions for monocular linear triangulation

    - by user1298891
    Recently I've been trying to implement a system to identify and triangulate the 3D position of an object in a robotic system. The general outline of the process goes as follows: Identify the object using SURF matching, from a set of "training" images to the actual live feed from the camera Move/rotate the robot a certain amount Identify the object using SURF again in this new view Now I have: a set of corresponding 2D points (same object from the two different views), two odometry locations (position + orientation), and camera intrinsics (focal length, principal point, etc.) since it's been calibrated beforehand, so I should be able to create the 2 projection matrices and triangulate using a basic linear triangulation method as in Hartley & Zissermann's book Multiple View Geometry, pg. 312. Solve the AX = 0 equation for each of the corresponding 2D points, then take the average In practice, the triangulation only works when there's almost no change in rotation; if the robot even rotates a slight bit while moving (due to e.g. wheel slippage) then the estimate is way off. This also applies for simulation. Since I can only post two hyperlinks, here's a link to a page with images from the simulation (on the map, the red square is simulated robot position and orientation, and the yellow square is estimated position of the object using linear triangulation.) So you can see that the estimate is thrown way off even by a little rotation, as in Position 2 on that page (that was 15 degrees; if I rotate it any more then the estimate is completely off the map), even in a simulated environment where a perfect calibration matrix is known. In a real environment when I actually move around with the robot, it's worse. There aren't any problems with obtaining point correspondences, nor with actually solving the AX = 0 equation once I compute the A matrix, so I figure it probably has to do with how I'm setting up the two camera projection matrices, specifically how I'm calculating the translation and rotation matrices from the position/orientation info I have relative to the world frame. How I'm doing that right now is: Rotation matrix is composed by creating a 1x3 matrix [0, (change in orientation angle), 0] and then converting that to a 3x3 one using OpenCV's Rodrigues function Translation matrix is composed by rotating the two points (start angle) degrees and then subtracting the final position from the initial position, in order to get the robot's straight and lateral movement relative to its starting orientation Which results in the first projection matrix being K [I | 0] and the second being K [R | T], with R and T calculated as described above. Is there anything I'm doing really wrong here? Or could it possibly be some other problem? Any help would be greatly appreciated.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >