SQ3 Build Questions

moved from SQ3 Build Questions

Trying to build Code from GitHub.

What version of Arduino needs to be used to compile QuadC_PS2_SSC32 for a quad with PS2 and SSC32?

the defines appear to be set, but I get an error in a core routine, main.cpp undefined reference to setup and loop?

(I thought I’d already compiled this code…)

moved from Phoenix Quadrudepod

Another question, I’m seeing multiple definitions for connecting the SSC-32 to the BotBoarduino.

sq3u-assembly.pdf shows connecting (pictorial) pins 12 and 13.
Build185 shows connecting to tx/rx (needed by USB)
Hex_Cfg.h #defines pins 10 and 11 I’m going to try this first.

It would be nice to have actual schematics of the interconnects, rather then pictorials, which may be helpful, but can be confusing tracing the wires.

the PS2 connections look OK, but I have the OLD PS2 receivers, not not the level converter (?) module. Any differences for the two versions in the code?

Found a better way to connect the fat 6V battery wires to the tiny terminals of the SSC32. I soldered a 3/8" length of .025" posts (used in .1" terminal strips) to the end of the wire, and covered the connection with shrink tube, leaving about 3/16" exposed. This can easily be inserted into the little terminal posts.

I made a mounting plate for a Hero 3 Camera rotate. Mount a Low Profile Axis Gear Set and Ball Bearing Hub Kit on to a piece of approximately 3" x 3" pcb stock.

Found a better place to mount the PS2 receiver. Filed two shallow grooves with a half-round file into the sides (not very deep) to allow the PS2 receiver to sit between two .189" 4-40 hex standoffs.

Alan KM6VV



Warning: I keep getting prompts saying I need to give a user name / password on this posting!

thanks for the feedback Kurt.
Try it now.

Alan KM6VV

Yep, thanks no longer getting prompts.

Which project up on Github? I personally use 1.0.5 or 1.5.2 of Arduino.

If this is the Lynxmotion account on Github, it is always possible it had issues. I believe I have most of Xan’s Quad updates in my Quad branch. Don’t currently have that branch active on my machine right now as I switched to main branch yesterday or day before to maybe put in some changes to the main branch to support the Version 2 of the PhantomX

Kurt

I got it from your Github:

github.com/KurtE/Phantom_Phoenix

It’s still up, you said you’re going to update it in a few days?

I’m using 1.0.3, so I’ll update that first, see if it fixes my compile…

Nope, no help with 1.0.5, still complains about ‘loop’ and ‘setup’ in a main in core code.

Alan KM6VV

Old Project… That is specific to the Trossen PhantomX and since then I incorporated everything into my combined project:
github.com/KurtE/Arduino_Phoeni … ad-Support

Note this version is the quad version which does not have much testing yet… The Main branch is what most people use, which I updated yesterday with what hopefully works for PhantomX V2. Did not test as I don’t have one (yet)

Nope, no help, still complains about ‘loop’ and ‘setup’ in a main in core code. I assume it compiles for you?

I have several versions of the Arduino IDE, I’m starting to wonder if the compiler is using an old hardware directory?

I will try a clean install on another computer, and see how it compiles there…

Alan KM6VV

The code in the folders assume that they are put in the arduino sketchbook libraries folder. You should be able to load the appropriate .ino file from the examples menu, by going to the Phoenix library. The actual sketch is pretty small, that includes all of the appropriate header files with the code. If I remember correctly the setup and loop functions are in the phoenix_code.h

Kurt

I must be missing something. I put the Zip contents w/file paths under my ‘Arduino’ sketch folder. I can get to the .ino file via the sketchbook and the path:

C:\ARobot\Robot Class\Arduino\Arduino_Phoenix_Parts-Quad-Support\QuadC_PS2_SSC32

Installed 1.0.5 Arduino IDE.

Alan KM6VV

The problem is that you are not moving the stuff into the Arduino Libraries folders. From the Readme (which I should get back to and put more text into :blush: )

With some of my other projects that I am more actively working on, I have started to improve the Readme files, including some support for the .md which gives me headers and the like.
Should probably do the same here. Alternatively could reorganize this code to use relative paths to include the sub-parts…

Kurt

FYI - I decided to do a quick edit of the Readme file that hopefully has a bit more useful information
Kurt

Hi Kurt,

I thought the file structure in the ZIP was a little different, but I let ZIP load the files. It actually compiled almost to the end.

I moved the library files under libraries:

Directory of C:\Program Files\Arduino\libraries
Phoenix
Phoenix_Driver_AX12
Phoenix_Driver_Orion
Phoenix_Driver_ServoEx
Phoenix_Driver_SSC32
Phoenix_Input_Commander
Phoenix_Input_DIYXbee
Phoenix_Input_PS2
Phoenix_Input_RC
Phoenix_Input_Serial

And put the two “builds” under Arduino:

Directory of C:\Program Files\Arduino

drivers
examples
hardware
java
lib
libraries
libusb0.dll
QuadC_PS2_SSC32
QuadC_XBee_SSC32

Sketchbook directory is: C:\Program Files\Arduino. The two ‘QuadC’ directories are in sketchbook.

Doesn’t like this arrangement at all, with a ton of errors in the library files. So that’s not the right layout.

I’ve got many, many Arduino builds, but again I’m having trouble getting files in the right locations. The ZIP could locate the files without all this trouble.

FireAnt built OK. 'tho.

What did you think of the camera mount, and the re-positioned PS2 receiver?

Thanks,

Alan KM6VV
arduino.txt (508 KB)

Not 100% sure what is going on with your layout. Since your last message I updated the Readme.md file that is in the quad support one as well as the main branch one.

I see that you put the stuff into the Arduino Libraries folder, which in theory should work. I have not done it that way in a long time as I often have multiple versions on my machine at the same time and hate to have to remember to install stuff in each of these.

That is why I put all of these into the Users Arduino libraries folder. In my case that is in the directory:
C:\Users\Kurt\Documents\Arduino\libraries

You might want to check to see if you have some of these directories (like Phoenix) inside a directory like this. This may cause a mix match of different files being included in the build

Kurt

C:\Users\Kurt\Documents\Arduino\libraries
Oh I see, under ‘Users’. I don’t have a directory like that, I think.

Got the memory card for my new goPro camera, been playing with that.

I need to get this to compile!

Alan KM6VV

Very strange that setup and loop are the undefined functions. They are in a .h file that in included all over.

Not sure why there is so much code in .h files, and not in the .ino files. I don’t normally put code in header files.

Any #defines that need to be set up?

Thanks,

Alan KM6VV

I found a similar place to put the files Arduino_Phoenix_Parts-Quad-Support and extracted the zip to this directory:

C:\Documents and Settings\Alan\My Documents\Arduino\libraries

I opened the QuadC_PS2_SSC32.ino file with 1.0.5, set up the sketch directory.

still can’t find loop and setup.

I compiled under ‘Uno’. (is there a BotBoarduino board choice?)

Is this the way you’re setting yours up? Maybe you could capture your user/directory into a file for me.

Thanks,

Alan KM6VV

First the easy stuff, All botboarduino compiles should be done with the Arduino Duemilanove with Atmega 328 as the board. The Uno setting probably won’t work (in the actual upload) as it does not use an FTDI chip for the USB connection…

My guess also is you don’t want to use the QuadC_PS2_SSC32.ino (I should remove this from the top level). That is configured for my Quad, that is the old style one and not the new Square one. Also mine has type C legs where the one Lynxmotion sells as type A legs.

I have an example build under the Phoenix folder that is called LSQuadA_PS2_SSC32 which is configured with the stuff from Xan’s build which includes square body and Type A legs…

Know why it does not compile for you? I am not sure. Will try downloading this stuff to my Portable that I don’t use very often and see if it works for me. Make sure the code includes:
Phoenix_code.h as this is where the code is. Also I need to double check if you have stated if this is being done on a PC or under Linux…

Note: the main INO file is pretty small, it just includes other stuff: Here is the LSQuadA-PS2_SSC32 (minus comments at top)

define DEFINE_HEX_GLOBALS
#if ARDUINO>99
#include <Arduino.h>
#else
#endif
#include <Wire.h>
#include <EEPROM.h>
#include <PS2X_lib.h>

#include <SoftwareSerial.h>
#include "Hex_CFG.h"
#include <Phoenix.h>
#include <Phoenix_Input_PS2.h>
#include <Phoenix_Driver_SSC32.h>
#include <Phoenix_Code.h>

Also you might want to turn on verbose compile (File Preferences) and check to make sure it loaded all of the appropriate files.
More as I figure it out.

Edit: I installed 1.0.5 on the portable (Had 1.0.1 on it so about time). I downloaded the Quad fork of the project as a zip file. I opened the Zip file…
I went to my Users Arduino Libraries folder and moved all of the folders out of it that started with Phoenix (put them to a dummy folder on my desktop). I then copied in the Phoenix* folders from the zip file into this folder.

I then started up Arduino 1.0.5. I then clicked on the File menu, then on the Examples menu item, then on the Phoenix menu item and then finally on LSQuadA_PS2_SSC32. This loaded up the project with two files in it. The main .INO file and Hex_Cfg.h. I then went to the Tools menu and selected the correct board (Arduino Duemilanove w…328) and then clicked on the Verify button and it compiled. Not sure what else to try here.

You asked Why .h files instead of .cpp/.c files? I am sorry this has been setup to make it easy for me. That is the easiest thing for the majority of users to use would be if they would choose a specific project and all of the files were self contained in it. That is great if you only have one robot and you only ever want to use one way to control it… But for me, I have many different configurations and when I wish to make fixes and/or enhancements, I did not want to have to make the same change in 10 different places. So I decided to make split the stuff up into libraries. But the problem with the Arduino environment and libraries is that there is no way to have compile time options. That is suppose some of your robots you wish to have GP sequence support included, but in other cases you don’t, there was no easy way to do that (at least that I found). But then I noticed a few cases where people put their code into header files instead, and this gave you that ability as the code is compiled with the main project code and not pre-compiled as part of the library. Hope that makes sense.

Note: Your Quad looks nice. It will be interesting to see how well it performs. Will the extra weight up top cause you to need to change how the weight shifting code is done as it walks.

Kurt

IBM ThinkCentere Pentium 4 running XP Pro.

So I don’t want QuadC_PS2_SSC32? OK.

I shifted sketch menu over to the LSQuadA_PS2_SSC32.ino directory, selected (Arduino Duemilanove w…328), I still get the two errors. Other ‘builds’ also give the same error.

I see ‘HEX’ and HEX_cfg in the above file, what makes it do a quad compile?

The QuadC_PS2_SSC32 file is the SAME as the LSQuadA_PS2_SSC32 file!

Are there any stand-alone builds for this new SQ3 QUAD?

Alan KM6VV

Probably should have renamed the files Hex_Cfg to Robot_Cfg :wink:

In those files there is a define:
#define QUADMODE // We are building for quad support…

Again at a loss, what the difference is between your build and mine.

If you turn on Verbose compile, are there any interesting compiler error/warnings? They show up in red/orange I only get a few warnings and they are directly in the Arduino system itself, like:

C:\Users\Kurt\AppData\Local\Temp\build3254052459355650124.tmp\HardwareSerial.cpp.o C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino\HardwareSerial.cpp: In function 'void store_char(unsigned char, ring_buffer*)': C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino\HardwareSerial.cpp:98: warning: comparison between signed and unsigned integer expressions C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino\HardwareSerial.cpp: In function 'void __vector_18()': C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino\HardwareSerial.cpp:127: warning: unused variable 'c' C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino\HardwareSerial.cpp: In member function 'void HardwareSerial::begin(long unsigned int, byte)': C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino\HardwareSerial.cpp:368: warning: unused variable 'current_config' C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino\HardwareSerial.cpp: In member function 'virtual size_t HardwareSerial::write(uint8_t)': C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino\HardwareSerial.cpp:467: warning: comparison between signed and unsigned integer expressions

The only changes between these two projects is the defines in the Hex_Cfg file. This includes Body and Leg dimensions, min/max angles and the like. Also with the new Square Quad, Xan had better luck with the front and back legs being mirrored instead of left/right, so which servos need to be reversed is different. His code hard whacked the changes into the arrays. Mine tries to allow the reversing of the servos to be set within the cfg file.

I don’t have any standalone builds here currently. I do have them as stand alone in the Linux builds as I am only supporting one configuration and I probably need work on the makefiles there to make it work properly… I will try to get you a Quick and dirty standone project. Give me a few minutes

Ok, I saved the project out, then I copied in the appropriate header files from the libraries (Phoenix, Phoenix_Code, Phoenix_Driver_SSC32, Phoenix_Input_PS2). I decided to rename them to add an _ to the start of the file names and I changed the main ino file to change the includes from something like:
#include <Phoenix.h>
to
#include “_Phoenix.h”

It them compiled for me, so I told the system to do an Archive of the project which I have now included: Hopefully this one compiles for you.

Kurt
LSQuadA_PS2_SSC32_Complete-130622a.zip (37.5 KB)

Verbose helps:

LSQuadA_PS2_SSC32.ino:29:22: warning: PS2X_lib.h: No such file or directory
In file included from LSQuadA_PS2_SSC32.ino:32:
/Hex_CFG.h:288:8: warning: extra tokens at end of #endif directive
LSQuadA_PS2_SSC32.ino:33:21: warning: Phoenix.h: No such file or directory
LSQuadA_PS2_SSC32.ino:34:31: warning: Phoenix_Input_PS2.h: No such file or directory
LSQuadA_PS2_SSC32.ino:35:34: warning: Phoenix_Driver_SSC32.h: No such file or directory
LSQuadA_PS2_SSC32.ino:36:26: warning: Phoenix_Code.h: No such file or directory

Seems like the compiler should have stopped when it encountered them. Path statement somewhere?

I saw an ‘add library’ on the top of the library list when I went to check the library. clicked it, and after a delay with a lot of disk activity, it crashed my system. Had to go through a ‘safe start’ to get it back up.

But I suspect that’s part of the problem. Do the ‘Phoenix’ libraries show up in your library list?

I am getting “The library Arduino_Phoenix_Parts-Quad-Support cannot be used”. Library names must contain only basic letters and numbers. But you’re using it as a directory name, right?

Thanks again for your help.

Alan KM6VV