loading
 
iRobot Create Module Problem
from United States  [60 posts]
7 years
I am working with the API to control my Create using the module. Here is a snippet from the .robo file:

<IRobot_Create>
    <start_oi_mode>3</start_oi_mode>
    <Advance_Button>AdvButton</Advance_Button>
</IRobot_Create>


and my API code:

    rr.getParameter("IRobot_Create",0,"start_oi_mode", buffer, sizeof buffer);
    cout << buffer << endl;
//    rr.setParameter("IRobot_Create",0,"start_oi_mode", "2");

    rr.getParameter("IRobot_Create",0,"start_oi_mode", buffer, sizeof buffer);
    cout << buffer << endl;

    for (int i = 0; i < 100; i++)
    {
        rr.getVariable("AdvButton", buffer, sizeof buffer);
        cout << buffer << endl;
        ::Sleep(100);
    }


This runs fine with the state of the Advance Button reported. But if the line setting the start_oi_mode module parameter runs the association of "AdvButton" name with Advance Button is lost. The state of the button is not returned.

An associated question is whether you can change the operating mode (safe, full) through a variable. I don't see a variable which is why this code use the module parameter change.

Another point is that changing the mode in the module dialog doesn't always change the mode on the Create.

RR Version 2.11.3
from United States  [60 posts] 7 years
I updated to RR 2.14.1. This problem still exists. Here is some more information.

From the .robo file:

    <Advance_Button>AdvButton</Advance_Button>
    <advance_led_map>AdvanceLed</advance_led_map>

When the operating mode parameter is change the variable AdvButton exists but its assignment to the Advance Button is lost. The assignment of AdvanceLed using the 'map' is not lost.

Anonymous 7 years
Rud,

the Advance_Button variable is a read only ... i.e. the create does not do anything with the current value, just overwrites it.

Perhaps you want to use the

advance_led_value

instead?

We have also added a OI mode variable called "oi_map" that can be set to a variable that contains either Off,Passive,Safe or Full to automatically change the mode.

<Set_Variable>
  <variable_1>test</variable_1>
  <value_1>safe</value_1>
</Set_Variable>

<IRobot_Create>
  <oi_map>test</oi_map>
</IRobot_Create>

STeven.

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index