Go to Post "What other program puts these role models on a first name basis with teenagers?" - Andy Baker [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 23-01-2016, 15:20
1024Programming 1024Programming is offline
Registered User
FRC #1024
 
Join Date: Jan 2014
Location: Indiana
Posts: 43
1024Programming is an unknown quantity at this point
Grip running out of memory

Hi, we are trying to get Grip working for the 2016 game. We can currently deploy to the robot and view network tables because of the new update less than a day ago; however, when we deployed the code on the grip wiki to make tracking work, we got this error in grip when deploying:
Code:
Loading Dependency Injection Framework
Jan 23, 2016 6:54:11 PM java.util.logging.LogManager$RootLogger log
CONFIG: Configuration done.
Jan 23, 2016 6:54:12 PM java.util.logging.LogManager$RootLogger log
CONFIG: GRIP Version: 1.1.1
platform: /Linux/arm/
Java HotSpot(TM) Embedded Client VM warning: INFO: os::commit_memory(0xad400000, 131072, 0) failed; error='Cannot allocate memory' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 131072 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /home/admin/hs_err_pid10269.log
We interpret this error to mean that the roborio has run out of memory. If we load this code onto the robot and look at the driver station it says that it has 24M of RAM available.
PS: We have changed the code deploying address to admin instead of lvuser because of a radio problem earlier.

This is the code that we have downloaded to the robot:
Code:
package org.usfirst.frc.team1024.robot;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.command.Command;
import edu.wpi.first.wpilibj.command.Scheduler;
import edu.wpi.first.wpilibj.livewindow.LiveWindow;
import edu.wpi.first.wpilibj.networktables.NetworkTable;

import org.usfirst.frc.team1024.robot.commands.ExampleCommand;
import org.usfirst.frc.team1024.robot.subsystems.ExampleSubsystem;
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import java.io.IOException;

public class Robot extends IterativeRobot {
	private final static String[] GRIP_ARGS = new String[] {
        "/usr/local/frc/JRE/bin/java", "-jar",
        "/home/admin/grip.jar", "/home/lvuser/project.grip" };
    private final NetworkTable grip = NetworkTable.getTable("grip");
    public static final ExampleSubsystem exampleSubsystem = new ExampleSubsystem();
	public static OI oi;
	Command autonomousCommand;
    SendableChooser chooser;
    @Override
    public void robotInit() {
    	/* Run GRIP in a new process */
        try {
            Runtime.getRuntime().exec(GRIP_ARGS);
        } catch (IOException e) {
            e.printStackTrace();
        }
		oi = new OI();
        chooser = new SendableChooser();
        chooser.addDefault("Default Auto", new ExampleCommand());
//        chooser.addObject("My Auto", new MyAutoCommand());
        SmartDashboard.putData("Auto mode", chooser);
    }
    public void disabledInit(){
    }
    public void disabledPeriodic() {
		Scheduler.getInstance().run();
	}
    public void autonomousInit() {
        autonomousCommand = (Command) chooser.getSelected();
        
		/* String autoSelected = SmartDashboard.getString("Auto Selector", "Default");
		switch(autoSelected) {
		case "My Auto":
			autonomousCommand = new MyAutoCommand();
			break;
		case "Default Auto":
		default:
			autonomousCommand = new ExampleCommand();
			break;
		} */
    	
    	// schedule the autonomous command (example)
        if (autonomousCommand != null) autonomousCommand.start();
    }
    @Override
    public void autonomousPeriodic() {
        Scheduler.getInstance().run();
        /* Get published values from GRIP using NetworkTables */
        for (double area : grip.getNumberArray("targets/area", new double[0])) {
            System.out.println("Got contour with area=" + area);
        }
    }
    public void teleopInit() {
		// This makes sure that the autonomous stops running when
        // teleop starts running. If you want the autonomous to 
        // continue until interrupted by another command, remove
        // this line or comment it out.
        if (autonomousCommand != null) autonomousCommand.cancel();
    }
    public void teleopPeriodic() {
        Scheduler.getInstance().run();
    }
    public void testPeriodic() {
        LiveWindow.run();
    }
}
Sorry for long code. If you have any reason for why the robot is running out of memory, please share with us.
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 10:29.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi