Botball Opencode++ and various additions

5 replies [Last post]
garrettsickles
garrettsickles's picture
Title: NooBot
Joined: 12/08/2011
Posts:
BotPoints: 52
User offline. Last seen 9 years 11 weeks ago.

Kevin Cotrone and I will be working on a new version of Opencode, an open source library of standard functions for use in robot programming, and are curious how we could improve our libraries to help with KIPR Link programming. All suggestions are welcome.

Garrett Sickles
807Robotics: A Narwhal's Revenge
Youth Advisory Council
Geophysics & Computer Science

Marty Rand
Marty Rand's picture
Title: Botball Youth Advisory Council
Joined: 07/04/2009
Posts:
BotPoints: 253
User offline. Last seen 8 years 41 weeks ago.

I should warn you that if you make it C++, all of the C wrapper functions won't exist. They only work in C. As for additions, Make the CBC / Link movements multiply the speed proportion by BOTH the speed and distance. Currently it is only the speed. Thus one wheel will move longer than the other if the proportions are different. Adding generic line following code would be useful for new teams (using 1 top hat or 2, keeping the tape in between the 2 top hats). Having a function that returns a median / mean filtered analog sensor value would be nice (with varying filter levels). Also, could you make the example code compile? I know the drivelib example doesn't right now.

-Marty Rand
{
Senior programmer at Norman Advanced Robotics

Former senior programmer at Whittier Middle School

Youth Advisory Council

All around nerd
}

Beta
Beta's picture
Title: The Magnificent
Joined: 02/24/2012
Posts:
BotPoints: 266
User offline. Last seen 9 years 15 weeks ago.

What do you mean by "they won't exist"? Are you talking about name mangling in C++ programs?

  1. #ifdef __cplusplus
  2. extern "C" {
  3. #endif
  4.  
  5. void this_function_works_in_both_c_and_cpp();
  6.  
  7. #ifdef __cplusplus
  8. }
  9. #endif

Braden McDorman

Developer of the KIPR Link, KISS IDE, KIPR's 2D Simulator, and CBCJVM.

Reach me at bmcdorman(cat)kipr(dog)org where (cat)=@ and (dog)=. if you need assistance of any kind.

Marty Rand
Marty Rand's picture
Title: Botball Youth Advisory Council
Joined: 07/04/2009
Posts:
BotPoints: 253
User offline. Last seen 8 years 41 weeks ago.

I was under the impression that mrp, bmd, analog10, etc only are for C and that you have to use moveRelativePosition, etc instead for C++. Am I mistaken?

-Marty Rand
{
Senior programmer at Norman Advanced Robotics

Former senior programmer at Whittier Middle School

Youth Advisory Council

All around nerd
}

Beta
Beta's picture
Title: The Magnificent
Joined: 02/24/2012
Posts:
BotPoints: 266
User offline. Last seen 9 years 15 weeks ago.

You can #include <kovan/kovan.h> manually to get C functions back.

Braden McDorman

Developer of the KIPR Link, KISS IDE, KIPR's 2D Simulator, and CBCJVM.

Reach me at bmcdorman(cat)kipr(dog)org where (cat)=@ and (dog)=. if you need assistance of any kind.

Marty Rand
Marty Rand's picture
Title: Botball Youth Advisory Council
Joined: 07/04/2009
Posts:
BotPoints: 253
User offline. Last seen 8 years 41 weeks ago.

Huh. Interesting. Thanks for the tip.

-Marty Rand
{
Senior programmer at Norman Advanced Robotics

Former senior programmer at Whittier Middle School

Youth Advisory Council

All around nerd
}