element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
STEM Projects
  • Learn
  • Learning Center
  • STEM Academy
  • STEM Projects
  • More
  • Cancel
STEM Projects
Blog Book Carrying Robot #7 Practical considerations and debugging
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join STEM Projects to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: mohanedessam
  • Date Created: 8 Sep 2015 4:25 AM Date Created
  • Views 1176 views
  • Likes 1 like
  • Comments 4 comments
  • image_processing
  • teachers_pet_robotics_design_challenge
  • teachers_pet
  • matlab_raspberry_pi
  • raspberry-pi
  • matlab
  • teachers pet robotics design challenge
  • debugging
  • digital_imaging
  • book_carrying_robot
  • parallel_for
  • simulink
Related
Recommended

Book Carrying Robot #7 Practical considerations and debugging

mohanedessam
mohanedessam
8 Sep 2015

After I showed my software design in this post, my hardware design in this post, and that I got some output in this post.

I started to test my robot on actual tasks, that's when I figured out some bugs in my code, also I had to change some parameters in my Simulink model and code to deal with some practical problems.

 

First, changes to my function code:

1- I have decreased the window size of my median filter from 5x5 to 3x3 to decrease the delay time.

2- I used the parallel for loop "parfor" instead of the normal for loop to do the color detection section of my script.

these changes are shown in the image below.



image



Second for the Simulink model I have changed the sampling time of my V4L2 block from [1/10] to [-1] (inherited sampling time).


image


So after that I normally run the Simulink model to check whether it's working before I deploy to Raspberry PI.

after deployment to Raspberry PI, I use the Raspberry PI shell to run the executable file deployed by the Simulink following these steps from the PC (these steps can also done using Putty software without needing MATLAB):

1- Start MATLAB

2- Run the command "rpi=raspi()" to connect to the Raspberry PI

3- Run the command "openShell(rpi)" to open the Raspberry PI shell

4- after entering the username and password (default is: username: pi , and password: raspberry) you can enter the commands shown in the image (replace "show_progress" with your model name)


image

 

However, I faced some errors and I will explain their solution:

1- Camera not detected as USB device (for details on how and why should we do that, please refer to this post); this can be solved just by waiting for some time before retrying again.


image


2- you find this error in the image below when trying to run the executable file:

image

for my case this meant that the last time I ran the model on Simulink I only used "Run" command not "deploy to hardware", so I had to open Simulink and deploy to hardware.

I have attached my modified model and made a separate file to show my function code.

Attachments:
show_progress_function.m.zip
5518.show_progress.rar
  • Sign in to reply

Top Comments

  • Former Member
    Former Member over 9 years ago in reply to clem57 +1
    Hmmmmm...so I should close the database connection? hmmmmmm........that gives me the impression that I'm missing something small but important...
  • mohanedessam
    mohanedessam over 9 years ago in reply to Former Member

    Hi Lindsey, I don't think I faced this problem before, but I think maybe you can try to follow the procedure I did for Setting-up MATLAB and Simulink, I have combined all the steps in one article, which can be found here: .. I hope this will be helpful

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Former Member
    Former Member over 9 years ago in reply to clem57

    Hmmmmm...so I should close the database connection? hmmmmmm........that gives me the impression that I'm missing something small but important...

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • clem57
    clem57 over 9 years ago in reply to Former Member

    Clue --- https://www.daniweb.com/programming/software-development/threads/352580/not-allowed-to-change-the-connectionstring-prope…

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Former Member
    Former Member over 9 years ago

    Hi,

    When I try to compile the model, I get this weird error message: Changing property 'ProdHWDeviceType' is not allowed

     

    Any clue why that might be doing that? I'm running this on R2015b.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube