OCCRA
Go to Post first robotics is a ten - Hiteak [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-13-2016, 04:22 PM
garystjean garystjean is offline
Registered User
FRC #1991
 
Join Date: Dec 2015
Location: CT
Posts: 7
garystjean is an unknown quantity at this point
FRCSIM Gazebo Model Problem

When using FRCSIM/Gazebo it works OK for a while, then the robot falls through the floor. Here is what I've been trying:

1) Download the 2016 world model for Gazebo from here: http://first.wpi.edu/FRC/roborio/rel.../frc2016.world

2) Installed/Configured FRCSIM and WPILIB Eclipse plugin per using the frcsim-installer.sh per wpi screensteps

3) Using the GearsBot sample code, I create a Java program and I am able to get the program running

4) I load up the frc2016.world file with frcsim and then I manually add the Gearsbot model to the world

5) After I drive it around successfully for a couple minutes the robot appears to drop through the floor, so only the top 1/2 of the robot is visible.

6) At this point there does not appear to be a way to use the robot, i need to delete it from the Gazebo world then re-insert a new Gearsbot model into the world.

7) I've attached a couple screenshots that show the before/after images.

Success
https://drive.google.com/file/d/0BxY...ew?usp=sharing

Failure
https://drive.google.com/file/d/0BxY...ew?usp=sharing

Has anyone else been having this problem? Is it a problem with the frc2016.world file?

Thanks
-Gary
  #2   Spotlight this post!  
Unread 02-13-2016, 04:50 PM
garystjean garystjean is offline
Registered User
FRC #1991
 
Join Date: Dec 2015
Location: CT
Posts: 7
garystjean is an unknown quantity at this point
Re: FRCSIM Gazebo Model Problem

Also, here is the output from the terminal where I ran frcsim:

gstjean@gstjean-ubuntu:~/wpilib/simulation/worlds$ frcsim frc2016.world
Gazebo multi-robot simulator, version 6.5.1
Copyright (C) 2012-2015 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

Gazebo multi-robot simulator, version 6.5.1
Copyright (C) 2012-2015 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[Msg] Waiting for master.
[Msg] Waiting for master.
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 10.160.169.9
[Msg] Publicized address: 10.160.169.9
[Msg] Initializing clock: /gazebo/frc/time
[Msg] Initializing motor: /gazebo/frc/simulator/pwm/1 joint=jFrontLeft multiplier=20
[Msg] Initializing motor: /gazebo/frc/simulator/pwm/2 joint=jBackLeft multiplier=20
[Msg] Initializing motor: /gazebo/frc/simulator/pwm/3 joint=jFrontRight multiplier=-20
[Msg] Initializing motor: /gazebo/frc/simulator/pwm/4 joint=jBackRight multiplier=-20
[Msg] Initializing encoder: /gazebo/frc/simulator/dio/1/2 joint=jBackLeft radians=0
[Msg] Initializing encoder: /gazebo/frc/simulator/dio/3/4 joint=jBackRight radians=0
[Msg] Initializing gyro: /gazebo/frc/simulator/analog/1 link=chassis axis=2 radians=0
[Msg] Initializing rangefinder: /gazebo/frc/simulator/analog/6 sensor=chassisUltrasonic
[Msg] Initializing motor: /gazebo/frc/simulator/pwm/5 joint=jElevator multiplier=20
[Msg] Initializing potentiometer: /gazebo/frc/simulator/analog/2 joint=jElevator radians=1
[Msg] Initializing motor: /gazebo/frc/simulator/pwm/6 joint=jWrist multiplier=5
[Msg] Initializing potentiometer: /gazebo/frc/simulator/analog/3 joint=jWrist radians=0
[Msg] Initializing motor: /gazebo/frc/simulator/pwm/7 joint=jLeftFinger multiplier=1
[Msg] Initializing motor: /gazebo/frc/simulator/pwm/7 joint=jRightFinger multiplier=1
[Msg] Initializing limit switch: /gazebo/frc/simulator/dio/5 type=external
[Msg] external limit switch: sensor=leftFingerContact
[Wrn] [Publisher.cc:140] Queue limit reached for topic /gazebo/default/pose/local/info, deleting message. This warning is printed only once.
  #3   Spotlight this post!  
Unread 02-13-2016, 06:09 PM
Peter Mitrano Peter Mitrano is offline
Registered User
no team
 
Join Date: Jan 2016
Location: Worcester MA
Posts: 23
Peter Mitrano is an unknown quantity at this point
Re: FRCSIM Gazebo Model Problem

Hey there! You're in luck--There is a well known solution to this.

You can find a detailed video that indirectly addresses the issue here

The issue is that the PID calculations can produce NaN if the timestep is too small. Sending NaN as a protobuf message over gazebo transport turns into 2000 netwons in Gazebo, and the robot kinda explodes... I haven't worked out a good solution to this yet, but an easy temporary fix is to write pidOutput in an if statement.

EX:

Code:
void usePIDOutput(double output){
  if (!Double.isNaN(output)){
    motor.set(output);
  }
}
  #4   Spotlight this post!  
Unread 02-16-2016, 12:59 PM
garystjean garystjean is offline
Registered User
FRC #1991
 
Join Date: Dec 2015
Location: CT
Posts: 7
garystjean is an unknown quantity at this point
Re: FRCSIM Gazebo Model Problem

Peter, Thanks for the detailed explanation on YouTube - that was very helpful.

-Gary
Closed Thread


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 04:05 PM.

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


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi