CLEARPATH Turtlebot4 User Manual page 100

Table of Contents

Advertisement

Create a class
Now that the dependencies are set, we can create a class that inherits from the
class. We will call this class TurtleBot4FirstNode.
class
TurtleBot4FirstNode
{
public:
TurtleBot4FirstNode()
: Node("turtlebot4_first_cpp_node")
{}
};
Notice that our class calls the
turtlebot4_first_cpp_node.
We can now create our node in the
will be created but it won't do anything.
int main(int
argc,
char
{
rclcpp::init(argc, argv);
rclcpp::spin(std::make_shared<TurtleBot4FirstNode>());
rclcpp::shutdown();
return 0;
}
: public rclcpp::Node
Node
constructor and passes it the name of our node,
main
function and spin it. Since our node is empty, the node
* argv[])
rclcpp::Node

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Turtlebot4 and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Turtlebot 4 lite

Table of Contents