You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Like we said during our presentation, we're trying to control our Pioneer 3DX with a mobile phone. To do that, we installed the application ROS All Sensors Driver (https://play.google.com/store/apps/details?id=org.ros.android.android_all_sensors_driver) and we used a ROS tutorial (http://wiki.ros.org/ROSARIA/Tutorials/Android%20teleop%20Pioneer%203at). So, as you can see in the tutorial, we make android_teleop.cpp, that contains all the instructions and we run this code with the CMakeLists.txt when we add the (rosbuild_add_executable(android_teleop android_teleop.cpp)) line to the CMakeLists.txt, but we are getting an error (as you can see in the image) and we don't know how to solve this. We already tried to add to the CMakeLists file the (add_executable(android_teleop android_teleop.cpp)) line, but that didn't solve the problem either. It seems like the executable line is not recognizable. Can you help us? CMakeLists.txt
The android_teleop.cpp file:
` /*
2 * Copyright (c) 2013, Anas Alhashimi LTU.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of the Willow Garage, Inc. nor the names of its
14 * contributors may be used to endorse or promote products derived from
15 * this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 * POSSIBILITY OF SUCH DAMAGE.
28 * Anas W. Alhahsimi
29 */
Also please consider to use the teleop keyboard, since your project is not about moving the robot with cellphone or joypad but just to make it move by any means, (in the fastest possible way)
Like we said during our presentation, we're trying to control our Pioneer 3DX with a mobile phone. To do that, we installed the application ROS All Sensors Driver (https://play.google.com/store/apps/details?id=org.ros.android.android_all_sensors_driver) and we used a ROS tutorial (http://wiki.ros.org/ROSARIA/Tutorials/Android%20teleop%20Pioneer%203at). So, as you can see in the tutorial, we make android_teleop.cpp, that contains all the instructions and we run this code with the CMakeLists.txt when we add the (rosbuild_add_executable(android_teleop android_teleop.cpp)) line to the CMakeLists.txt, but we are getting an error (as you can see in the image) and we don't know how to solve this. We already tried to add to the CMakeLists file the (add_executable(android_teleop android_teleop.cpp)) line, but that didn't solve the problem either. It seems like the executable line is not recognizable. Can you help us?
CMakeLists.txt
The android_teleop.cpp file:
` /*
2 * Copyright (c) 2013, Anas Alhashimi LTU.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of the Willow Garage, Inc. nor the names of its
14 * contributors may be used to endorse or promote products derived from
15 * this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 * POSSIBILITY OF SUCH DAMAGE.
28 * Anas W. Alhahsimi
29 */
#include <ros/ros.h>
#include "geometry_msgs/Twist.h"
#include "ROSARIA/BumperState.h"
#include "sensor_msgs/Imu.h"
#include <signal.h>
#include <termios.h>
using geometry_msgs::Twist;
using namespace std;
ros::Publisher chatter_pub;
ros::Time t1;
Twist vel;
int kfd = 0;
struct termios cooked, raw;
unsigned int temp=0;
float x;
float y;
float z;
void quit(int sig)
{
tcsetattr(kfd, TCSANOW, &cooked);
ros::shutdown();
exit(0);
}
void anCallback(const sensor_msgs::Imu::ConstPtr& ansmsg)
{
x=ansmsg->angular_velocity.x;
y=ansmsg->angular_velocity.y;
z=ansmsg->angular_velocity.z;
}
int main(int argc, char** argv)
{
int ther=5;
ros::init(argc, argv, "android_teleop");
ros::NodeHandle n;
chatter_pub = n.advertise("/cmd_vel", 1);
signal(SIGINT,quit);
ros::Rate r(5);
char c;
bool dirty=false;
t1=ros::Time::now();
//subscribe to android imu sensor msgs
ros::Subscriber imu_pub = n.subscribe<sensor_msgs::Imu>("/android/imu", 1, anCallback);
while (ros::ok())
{
if(x > ther)
{
vel.linear.x = 0.2;
vel.linear.y=0;
vel.linear.z=0;
vel.angular.x = 0;
vel.angular.y = 0;
vel.angular.z = 0;
ROS_INFO("forward");
}
if(x < -ther)
{
vel.linear.x = -0.2;
vel.linear.y=0;
vel.linear.z=0;
vel.angular.x = 0;
vel.angular.y = 0;
vel.angular.z = 0;
ROS_INFO("Backward");
}
if(z > ther)
{
vel.linear.x = 0;
vel.linear.y=0;
vel.linear.z=0;
vel.angular.x = 0;
vel.angular.y = 0;
vel.angular.z = 0.5;
ROS_INFO("Turnleft");
}
if(z < -ther)
{
vel.linear.x = 0;
vel.linear.y=0;
vel.linear.z=0;
vel.angular.x = 0;
vel.angular.y = 0;
vel.angular.z = -0.5;
ROS_INFO("Turnright");
}
if(y < -ther)
{
vel.linear.x = 0;
vel.linear.y=0;
vel.linear.z=0;
vel.angular.x = 0;
vel.angular.y = 0;
vel.angular.z = 0;
ROS_INFO("stop");
}
if(y > ther)
{
vel.linear.x = 0;
vel.linear.y=0;
vel.linear.z=0;
vel.angular.x = 0;
vel.angular.y = 0;
vel.angular.z = 0;
ROS_INFO("stop");
}
ros::Duration(0.1).sleep(); // sleep for one tenth of a second
}//while
return(0);
}
`
The text was updated successfully, but these errors were encountered: