View unanswered posts | View active topics It is currently Fri Sep 21, 2018 7:46 am






Reply to topic  [ 20 posts ]  Go to page 1, 2  Next
Has EV3 I2C for 3rd party sensors been fixed? 
Author Message
Rookie

Joined: Sun Jan 23, 2011 3:14 am
Posts: 16
Post Has EV3 I2C for 3rd party sensors been fixed?
Just wondering if 3rd Party Sensors drivers(eg IR Seeker V2, HT IRDIST) have been updated to work with the EV3?


Sat Dec 13, 2014 1:42 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: Has EV3 I2C for 3rd party sensors been fixed?
Yes :) I just need to tweak the driver suite a bit to make it work a little more smoothly.

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Wed Dec 24, 2014 11:24 am
Profile WWW
Rookie
User avatar

Joined: Mon Apr 08, 2013 12:50 pm
Posts: 30
Post Re: Has EV3 I2C for 3rd party sensors been fixed?
Hello Xander!

I want to make a Robot with EV3 and HT compass and Dexter GPS. Did you make the Drivers for them already?
And if yes, where can I download them?

Best regards,

Sigtrygg


Tue Jan 06, 2015 1:18 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: Has EV3 I2C for 3rd party sensors been fixed?
The 3rd party sensor driver has not been fully tested yet with the EV3. Some drivers work fine, I have tested several. Others are still exhibiting issues. The functions in ROBOTC, however, work fine :)

Any updated I make, will be put on the Github repository here: https://github.com/botbench/robotcdriversuite

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Wed Jan 07, 2015 3:03 am
Profile WWW
Rookie
User avatar

Joined: Mon Apr 08, 2013 12:50 pm
Posts: 30
Post Re: Has EV3 I2C for 3rd party sensors been fixed?
Thank you for your quick answer!

The new concept with the struct variables and equal commands is very good.
I defined my sensor "HTCompass" and are able to apply commands like initSensor(&HTCompass, S1), readSensor(&HTCompass), sensorCalibrate(&HTCompass), sensorStopCalibrate(&HTCompass) and can use values like HTCompass.relativeHeading, HTCompass.heading but I can't find the command for setting the target heading. I don't understand how the relative target is calculated without setting the target heading.

Maybe you can help me?

Best regards,

Sigtrygg


Wed Jan 07, 2015 4:25 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: Has EV3 I2C for 3rd party sensors been fixed?
Without the target heading, it is not possible to calculate the relative heading without a target. You can set the target to whatever you'd like. I've put the code below that show you how to do it. This is also found in hitechnic-compass-test1.c.

Code:
/**
 * hitechnic-compass.h provides an API for the HiTechnic Compass Sensor.  This program
 * demonstrates how to use that API.
 *
 * Changelog:
 * - 0.1: Initial release
 * - 0.2: More comments
 *
 * License: You may use this code as you wish, provided you give credit where it's due.
 *
 * THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 4.10 AND HIGHER

 * Xander Soldaat (xander_at_botbench.com)
 * 25 November 2009
 * version 0.2
 */

#include "hitechnic-compass.h"

task main () {
  displayCenteredTextLine(0, "HiTechnic");
  displayCenteredBigTextLine(1, "Compass");
  displayCenteredTextLine(3, "Test 1");
  displayTextLine(5, "Press enter");
  displayTextLine(6, "to set target");

  sleep(2000);
  eraseDisplay();

  // Create struct to hold sensor data
  tHTMC compass;

  // Initialise and configure struct and port
  initSensor(&compass, S1);

  time1[T1] = 0;
  while(true) {
    // Reset the target no more than once a second
    // This also helps with debouncing the [enter] button.
    if (time1[T1] > 1000) {
      eraseDisplay();
      displayTextLine(1, "Changing");
      displayTextLine(2, "target");
      sleep(500);

      // Read the data from the sensor
      readSensor(&compass);

      // Set the current heading as the value for the offset to be used as the
      // new zero-point for the relative heading returned by
      // compass.relativeHeading
      compass.offset = compass.heading;

      playSound(soundBlip);
      while(bSoundActive) sleep(1);
      time1[T1] = 0;
    }

    // Get the true heading and relative heading from the sensor and
    // display them on the screen.
    while(!getXbuttonValue(xButtonEnter)) {
       // Read the data from the sensor
      readSensor(&compass);
      eraseDisplay();
      displayTextLine(1, "Reading");
      displayTextLine(2, "Target: %4d", compass.offset);
      displayTextLine(4, "Abs:   %4d", compass.heading);
      displayTextLine(5, "Rel:   %4d", compass.relativeHeading);
      displayTextLine(6, "Press enter");
      displayTextLine(7, "to set target");
      sleep(100);
    }
  }
}

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Thu Jan 08, 2015 5:40 am
Profile WWW
Rookie
User avatar

Joined: Mon Apr 08, 2013 12:50 pm
Posts: 30
Post Re: Has EV3 I2C for 3rd party sensors been fixed?
Great! Thank you very much, Xander! :D

I know, it is a lot of work to make all these drivers.

I try to apply this API for my robot and will show the results with code here.

Best regards,

Sigtrygg


Thu Jan 08, 2015 12:22 pm
Profile
Rookie
User avatar

Joined: Mon Apr 08, 2013 12:50 pm
Posts: 30
Post Re: Has EV3 I2C for 3rd party sensors been fixed?
Hello Xander!

I have tried the hitechnic-compass.c example with hitechnic-compass.h and common.h, but it didn't work with my robot. :-(
And although I have defined the compass sensor as I2CCustom it is shown as I2CGenericEV3 into the debug sensor window.
The compass shows once values and then it blocks completely.
I can't explain that. Do you have a hint for me? I added two screencopies with debug stream and settings.

Best regards,

Sigtrygg


Attachments:
picture2.png
picture2.png [ 272.66 KiB | Viewed 14804 times ]
picture1.png
picture1.png [ 239.57 KiB | Viewed 14804 times ]
Fri Jan 09, 2015 2:10 pm
Profile
Rookie
User avatar

Joined: Mon Apr 08, 2013 12:50 pm
Posts: 30
Post Re: Has EV3 I2C for 3rd party sensors been fixed?
Hello Xander!

I guess my EV3-brick doesn't work.
I tried the compass with the LEGO-Software and it blocked, too.
Then I tried the sonar sensor with the same result.

I bought the brick from ebay. Don't waste your time and please forget my last post!!!!


Sat Jan 10, 2015 11:47 am
Profile
Rookie
User avatar

Joined: Mon Apr 08, 2013 12:50 pm
Posts: 30
Post Re: Has EV3 I2C for 3rd party sensors been fixed?
Oh! The brick is o.k!

I tried HT compass sensor and sonar sensor with LEGO Software and it works.
I made a mistake because I never used this Software.
Sorry for confusion!

So, why doesn't work the compass sensor with my RobotC??
Is there anybody who has the same Problems?

Bye,
Sigtrygg


Sat Jan 10, 2015 2:04 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: Has EV3 I2C for 3rd party sensors been fixed?
Hey there,

I just tested my HT Compass sensor with my EV3 using the latest internal version of the drivers and it works very nicely.

I will do a bit more testing and then I'll commit to the Github repo where you can download it :)

= Xander


Attachments:
Screenshot at 16-56-51.png
Screenshot at 16-56-51.png [ 214.49 KiB | Viewed 14709 times ]

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]
Sun Jan 11, 2015 11:58 am
Profile WWW
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: Has EV3 I2C for 3rd party sensors been fixed?
All done, get your fresh copy from: https://github.com/botbench/robotcdriversuite

There will still be bugs and a LOT more testing is needed, but the compass sensor works and the code to make that happen is fairly cross platform. I need to check the other drivers too, I haven't had a chance to do that yet :)

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sun Jan 11, 2015 12:08 pm
Profile WWW
Rookie
User avatar

Joined: Mon Apr 08, 2013 12:50 pm
Posts: 30
Post Re: Has EV3 I2C for 3rd party sensors been fixed?
Hello Xander!

Thank you very much for your support!! :bigthumb:
The compass is running very well, now!
I hope, I can introduce my new robot project, soon. But there is still a lot to do for me.

Best regards,

Sigtrygg


Sun Jan 11, 2015 1:55 pm
Profile
Rookie

Joined: Thu Jan 15, 2015 10:57 am
Posts: 9
Location: Italy
Post Re: Has EV3 I2C for 3rd party sensors been fixed?
Hi everyone (sorry for my poor english... I'm italian)
I'm trying to run a simple program for hitechnic IR Seeker V2 in my new EV3, but I got error

Code:
**Error**:Undefined variable 'i2cStatusStopped'. 'short' assumed.


I'm using RobotC 4.27 with latest version of robotcdriversuite-master

this is my program

Code:
#pragma config(Sensor, S2,     SENS_SEEKER,    sensorEV3_GenericI2C)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

#include "hitechnic-irseeker-v2.h"

task main()
{
    while (true) {
   displayCenteredTextLine ( 2, "SEEKER value: %d", SensorValue[SENS_SEEKER]);
   }
}


where am I wrong?

_________________
for my blog I use the best hosting wordpress


Thu Jan 15, 2015 12:14 pm
Profile WWW
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: Has EV3 I2C for 3rd party sensors been fixed?
Please update to 4.28: http://www.robotc.net/blog/2014/12/23/r ... 4-28-beta/

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Thu Jan 15, 2015 12:39 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 20 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.