ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I suggest you create a player class and take the main method out of it. This way, you can instantiate a new robot and use it as a variable in a ROS class.
What I mean:
First class: - PlayerLaser (inherits player) - starts player (from inherited methods) - has laser messages (now laser is an object)
Second class: - RosLaser - Has methods to get laser data. - Has a return method
In your main method (separate entity): - create a ROS publisher - create a Robot (or PlayerLaser) - have a RosLaser::getLaserMessage() function that returns the ROS laser type - publish the method
There are some examples with a player class on my github.
2 | No.2 Revision |
I suggest you create a player class and take the main method out of it. This way, you can instantiate a new robot and use it as a variable in a ROS class.
What I mean:
First class: - PlayerLaser (inherits player) - starts player (from inherited methods) - has laser messages (now laser is an object)
Second class: - RosLaser - Has methods to get laser data. - Has a return method
In your main method (separate entity): - create a ROS publisher - create a Robot (or PlayerLaser) - have a RosLaser::getLaserMessage() function that returns the ROS laser type - publish the method
3 | No.3 Revision |
I suggest you create a player class and take the main method out of it. This way, you can instantiate a new robot and use it as a variable in a ROS class.
What I mean:
First class:
Second class:
In your main method (separate entity): - create a ROS publisher - create a Robot (or PlayerLaser) - have a RosLaser::getLaserMessage() function that returns the ROS laser type - publish the method
There are some examples with a player class on my github.
4 | Made the answer all pretty. |
I suggest you create a player class and take the main method out of it. This way, you can instantiate a new robot and use it as a variable in a ROS class.
What I mean:
First class:
Second class:
In your main method (separate (separate
entity):
-
create a ROS publisher
- publisher create a Robot (or PlayerLaser)
- PlayerLaser) have a RosLaser::getLaserMessage() function that returns the ROS laser type
- laser
type publish the method
There are some examples with a player class on my github.
5 | No.5 Revision |
I suggest you create a player class and take the main method out of it. This way, you can instantiate a new robot and use it as a variable in a ROS class.
What I mean:
First class:
Second class:
There are some examples with a player class on my github. As for a ROS class, look here.