rb-110 example code

Based on DMP's Vortex processor / SoC this board is a full computer capable of running a standard Windows and Linux installation on the backpack of your robot.
20 postsPage 2 of 21, 2
20 postsPage 2 of 21, 2

Post by roboard » Tue Feb 15, 2011 3:05 am

Post by roboard
Tue Feb 15, 2011 3:05 am

please check the range of the servo duty.

If the servo position that you set is out of the range, the servo will not work. :)
please check the range of the servo duty.

If the servo position that you set is out of the range, the servo will not work. :)
roboard offline
Savvy Roboteer
Savvy Roboteer
Posts: 302
Joined: Fri Jul 03, 2009 4:44 am

Post by hellu » Wed Feb 16, 2011 12:04 am

Post by hellu
Wed Feb 16, 2011 12:04 am

roboard wrote:please check the range of the servo duty.

If the servo position that you set is out of the range, the servo will not work. :)

I've encountered this problem with the width out of range and I cannot solve it, any value I put in the nofb_home_position and servo_position arry. What type of data must it contain, I see it is uint and the value is in us. For the middle of the servo i guess it is 1500, right?

The error that it gives me is
"warning: set_play mode_pulses() receives width 0 out of range for channel 15! "
What can it be the problem?

Here is the code. 1st it should go to 1500 then to 1800, but it goes to the end and gives "warning: set_play mode_pulses() receives width 0 out of range for channel 15! " in the console.

using System;
using System.Collections.Generic;
using System.Text;
using RoBoIO_DotNet;
using System.Threading;

namespace example_sv
{
class example_sv
{
static void Main(string[] args)
{
uint[] position = new uint[32];
uint[] home = new uint[32];
home[0] = 1500 ;
position[0] = 1800;
RoBoIO.roboio_SetRBVer(RoBoIO.RB_110);
if (RoBoIO.rcservo_SetServo(15, RoBoIO.RCSERVO_SERVO_DEFAULT_NOFB) == false)
{
Console.Write(RoBoIO.roboio_GetErrMsg());
return;
}
if (RoBoIO.rcservo_Initialize(RoBoIO.RCSERVO_USECHANNEL15) == false)
{
Console.Write(RoBoIO.roboio_GetErrMsg());
return;
}
RoBoIO.rcservo_EnterPlayMode_NOFB(home);
RoBoIO.rcservo_MoveTo(position, 1000);
Console.ReadLine();
RoBoIO.rcservo_Close();

return;
}
}
}



Best regards, Vlad
roboard wrote:please check the range of the servo duty.

If the servo position that you set is out of the range, the servo will not work. :)

I've encountered this problem with the width out of range and I cannot solve it, any value I put in the nofb_home_position and servo_position arry. What type of data must it contain, I see it is uint and the value is in us. For the middle of the servo i guess it is 1500, right?

The error that it gives me is
"warning: set_play mode_pulses() receives width 0 out of range for channel 15! "
What can it be the problem?

Here is the code. 1st it should go to 1500 then to 1800, but it goes to the end and gives "warning: set_play mode_pulses() receives width 0 out of range for channel 15! " in the console.

using System;
using System.Collections.Generic;
using System.Text;
using RoBoIO_DotNet;
using System.Threading;

namespace example_sv
{
class example_sv
{
static void Main(string[] args)
{
uint[] position = new uint[32];
uint[] home = new uint[32];
home[0] = 1500 ;
position[0] = 1800;
RoBoIO.roboio_SetRBVer(RoBoIO.RB_110);
if (RoBoIO.rcservo_SetServo(15, RoBoIO.RCSERVO_SERVO_DEFAULT_NOFB) == false)
{
Console.Write(RoBoIO.roboio_GetErrMsg());
return;
}
if (RoBoIO.rcservo_Initialize(RoBoIO.RCSERVO_USECHANNEL15) == false)
{
Console.Write(RoBoIO.roboio_GetErrMsg());
return;
}
RoBoIO.rcservo_EnterPlayMode_NOFB(home);
RoBoIO.rcservo_MoveTo(position, 1000);
Console.ReadLine();
RoBoIO.rcservo_Close();

return;
}
}
}



Best regards, Vlad
hellu offline
Robot Builder
Robot Builder
Posts: 18
Joined: Thu Jan 06, 2011 5:34 pm

Post by roboard » Wed Feb 16, 2011 2:13 am

Post by roboard
Wed Feb 16, 2011 2:13 am

If you use channel 15, must assign values to position[15] and home[15]. :)

please, change

uint[] position = new uint[32];
uint[] home = new uint[32];
home[0] = 1500 ;
position[0] = 1800;


to

uint[] position = new uint[32];
uint[] home = new uint[32];
home[15] = 1500 ;
position[15] = 1800;


and try it again. :D
If you use channel 15, must assign values to position[15] and home[15]. :)

please, change

uint[] position = new uint[32];
uint[] home = new uint[32];
home[0] = 1500 ;
position[0] = 1800;


to

uint[] position = new uint[32];
uint[] home = new uint[32];
home[15] = 1500 ;
position[15] = 1800;


and try it again. :D
roboard offline
Savvy Roboteer
Savvy Roboteer
Posts: 302
Joined: Fri Jul 03, 2009 4:44 am

Post by hellu » Wed Feb 16, 2011 6:25 am

Post by hellu
Wed Feb 16, 2011 6:25 am

Thanks, it worked now.

Best regards, Vlad
Thanks, it worked now.

Best regards, Vlad
hellu offline
Robot Builder
Robot Builder
Posts: 18
Joined: Thu Jan 06, 2011 5:34 pm

Post by roboard » Wed Mar 30, 2011 3:43 pm

Post by roboard
Wed Mar 30, 2011 3:43 pm

To everyone who uses .NET:

RoBoIO 1.7 software introduction slides & sample codes for both C# & VB.NET are now available in the binary package of RoBoIO 1.7 .NET Warper. Please go to http://www.roboard.com/download_ml.htm to download the package.

:)
To everyone who uses .NET:

RoBoIO 1.7 software introduction slides & sample codes for both C# & VB.NET are now available in the binary package of RoBoIO 1.7 .NET Warper. Please go to http://www.roboard.com/download_ml.htm to download the package.

:)
roboard offline
Savvy Roboteer
Savvy Roboteer
Posts: 302
Joined: Fri Jul 03, 2009 4:44 am

Previous
Previous
20 postsPage 2 of 21, 2
20 postsPage 2 of 21, 2
cron