Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 770853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:33:55+00:00 2026-05-14T18:33:55+00:00

I’m working on a robot localization simulator and I created a class called landmark.

  • 0

I’m working on a robot localization simulator and I created a class called “landmark”.

The end result is going to be a robot that is always centered and always faces the top of the screen. As it turns, the birds eye view map will rotate around the robot. To accomplish this, I’m assuming I can rotate one class and have all elements inside rotate as well.

So, the landmark class has properties x,y, label, and radius. This is suppose to simulate a tree location in a forest.

To test everything, I need “forest data,” and I wrote a script to generate 100 trees in a 100m x 100m area. The script automatically generates values within an acceptable range for x,y, radius. The generated data is stored in an object called tempForest and is 100×3.

Ideally, I want to create a class called “landmarks” (plural) that has 100 landmark instances inside.

How would I instantiate 100 instances of landmark in one instance of landmarks using that randomly generated data?

Ideally, I’d just type treeBeacons = landmarks(); and it would randomly populate 100 (user definable, set in config file) instances with x, y, radius data.

I’m not sure how to deal with a dynamic array of class “Landmark”, inside another single class “landmarks.”

Any ideas?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T18:33:55+00:00Added an answer on May 14, 2026 at 6:33 pm

    I’d create a class ‘landmarks’ that has a property ‘fixedPositions’, a property ‘viewDirection’, and a dependent property ‘apparentPositions’.

    If you type treeBeacons=landmarks;, you can have the constructor fill in fixedPositions, which is the list of positions of your trees. You then set treeBeacons.facing to whatever direction the robot is facing, and you can get the forest relative to the robot as treeBeacons.apparentPositions.

    I don’t think it is necessary to have your trees be objects, given your description. However, if your trees really need to be individual objects, you have the constructor of landmarks create objects instead of coordinates and store them in fixedPositions (or trees) instead. Let me just suggest that you do not use both landmarks and landmark as different variable names. At least the common people like me have a very hard time telling the two apart.

    classdef landmarks
        properties
            fixedPositions %# positions in a fixed coordinate system. [ x, y, radius ]
            facing = 0;%# direction in which the robot is facing
        end
        properties (Dependent)
            apparentPositions
        end
        methods
            function obj = landmarks(numberOfTrees)
                 %# set  obj.fixedPositions here depending on the number of trees. 
            end
            function out = get.apparentPositions(obj)
                %# rotate obj.positions using obj.facing to generate the output
            end
            function plotMap(obj,fixedOrApparent)
                %# plots the map, either using fixed or apparent coordinates (good for testing)
            end
        end
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I know there's a lot of other questions out there that deal with this
I need a function that will clean a strings' special characters. I do NOT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.