ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

No... Sorry for the misunderstanding... You need to create a package. Navigate to your ROS workspace (for you it should be done by cd ~/ros_workspace) then run the following command.

roscreate-pkg p2osTutorial roscpp geometry_msgs nav_msgs

Then add the following line to the CMakeLists.txt:

rosbuild_add_executable(eo_pose src/eo_pose.cc)

Note: you need to move your source to the subdirectory src.

No... Sorry for the misunderstanding... You need to create a package. Navigate to your ROS workspace (for you it should be done by cd ~/ros_workspace) then run the following command.

roscreate-pkg p2osTutorial roscpp geometry_msgs nav_msgs

Then add the following line to the CMakeLists.txt:

rosbuild_add_executable(eo_pose src/eo_pose.cc)

Note: you need to move your source to the subdirectory src.


Update: I have now added a new tutorial called Setup. I also updated the tutorial you are using with some more detail.

No... Sorry for the misunderstanding... You need to create a package. Navigate to your ROS workspace (for you it should be done by cd ~/ros_workspace) then run the following command.

roscreate-pkg p2osTutorial roscpp geometry_msgs nav_msgs

Then add the following line to the CMakeLists.txt:

rosbuild_add_executable(eo_pose src/eo_pose.cc)

Note: you need to move your source to the subdirectory src.


Update: I have now added a new tutorial called Setup. I also updated the tutorial you are using with some more detail.


Ok, so I see the confusion now... You will not need to run any g++ commands at all. If you have not done so, I recommend that you go through the ROS tutorials to get a better understanding of how the build process works. To answer your question, yes, it is a package. You will have ROS run the program with a rosrun command.

No... Sorry for the misunderstanding... You need to create a package. Navigate to your ROS workspace (for you it should be done by cd ~/ros_workspace) then run the following command.

roscreate-pkg p2osTutorial roscpp geometry_msgs nav_msgs

Then add the following line to the CMakeLists.txt:

rosbuild_add_executable(eo_pose src/eo_pose.cc)

Note: you need to move your source to the subdirectory src.


Update: I have now added a new tutorial called Setup. I also updated the tutorial you are using with some more detail.


Ok, so I see the confusion now... You will not need to run any g++ commands at all. If you have not done so, I recommend that you go through the ROS tutorials to get a better understanding of how the build process works. To answer your question, yes, it is a package. You will have ROS run the program with a rosrun command.


I think I know the issue... You might not be enabling the motors. Run the p2os_dashboard and enable the motors. Alternatively, you can use the vanderbilt-ros-pkg. A lab member wrote a node to do this. It's called p2os_enableMotor.

Here's how you can use it:

roscd && cd ../src
git clone https://github.com/allenh1/vanderbilt-ros-pkg.git
source ../devel/setup.bash
rosmake p2os_enableMotor
rosrun p2os_enableMotor enableMotor

That should make the pioneer movable. The motors are not enabled by default.

No... Sorry for the misunderstanding... You need to create a package. Navigate to your ROS workspace (for you it should be done by cd ~/ros_workspace) then run the following command.

roscreate-pkg p2osTutorial roscpp geometry_msgs nav_msgs

Then add the following line to the CMakeLists.txt:

rosbuild_add_executable(eo_pose src/eo_pose.cc)

Note: you need to move your source to the subdirectory src.


Update: I have now added a new tutorial called Setup. I also updated the tutorial you are using with some more detail.


Ok, so I see the confusion now... You will not need to run any g++ commands at all. If you have not done so, I recommend that you go through the ROS tutorials to get a better understanding of how the build process works. To answer your question, yes, it is a package. You will have ROS run the program with a rosrun command.


I think I know the issue... You might not be enabling the motors. Run the p2os_dashboard and enable the motors. Alternatively, you can use the vanderbilt-ros-pkg. A lab member wrote a node to do this. It's called p2os_enableMotor.

Here's how you can use it:

roscd && cd ../src
git clone https://github.com/allenh1/vanderbilt-ros-pkg.git
source ../devel/setup.bash
rosmake p2os_enableMotor
rosrun p2os_enableMotor enableMotor

That should make the pioneer movable. The motors are not enabled by default.


Huzzah! I see it now. The controller node is not interfacing with the p2os node. Could you email me/post the code for your controller? I want to make sure there isn't something weird going on.

No... Sorry for the misunderstanding... You need to create a package. Navigate to your ROS workspace (for you it should be done by cd ~/ros_workspace) then run the following command.

roscreate-pkg p2osTutorial roscpp geometry_msgs nav_msgs

Then add the following line to the CMakeLists.txt:

rosbuild_add_executable(eo_pose src/eo_pose.cc)

Note: you need to move your source to the subdirectory src.


Update: I have now added a new tutorial called Setup. I also updated the tutorial you are using with some more detail.


Ok, so I see the confusion now... You will not need to run any g++ commands at all. If you have not done so, I recommend that you go through the ROS tutorials to get a better understanding of how the build process works. To answer your question, yes, it is a package. You will have ROS run the program with a rosrun command.


I think I know the issue... You might not be enabling the motors. Run the p2os_dashboard and enable the motors. Alternatively, you can use the vanderbilt-ros-pkg. A lab member wrote a node to do this. It's called p2os_enableMotor.

Here's how you can use it:

roscd && cd ../src
git clone https://github.com/allenh1/vanderbilt-ros-pkg.git
source ../devel/setup.bash
rosmake p2os_enableMotor
rosrun p2os_enableMotor enableMotor

That should make the pioneer movable. The motors are not enabled by default.


Huzzah! I see it now. The controller node is not interfacing with the p2os node. Could you email me/post the code for your controller? I want to make sure there isn't something weird going on.


My goodness... This is my fault. Try this code:

const double TWIST_LINEAR = 0.5; //.5 m/s forward
const double TWIST_ANGULAR = 0; //0 rad/s 
int main(int argc, char **argv)
{
    ros::NodeHandle n;

    ros::Publisher cmd_pub = n.advertise<geometry_msgs::Twist>("/cmd_vel", 100);

    ros::Rate loop_rate(10);

    while (ros::ok())
    {
        geometry_msgs::Twist cmd_msg;
        cmd_msg.linear.x = TWIST_LINEAR;
        cmd_msg.angular.z = TWIST_ANGULAR;


        cmd_pub.publish(cmd_msg);

        ros::spinOnce();

        loop_rate.sleep();
    }


    return 0;
}