Hi
i am having the same problem using the copy paste of the code from the course:
#!/bin/bash
ARG1=$1
if [ $ARG1 == 'forward' ]; then
rostopic pub /cmd_vel geometry_msgs/Twist "linear:
x: -0.1
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.0"
elif [ $ARG1 == 'rotate' ]; then
rostopic pub /cmd_vel geometry_msgs/Twist "linear:
x: 0.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.2"
elif [ $ARG1 == 'stop' ]; then
rostopic pub /cmd_vel geometry_msgs/Twist "linear:
x: 0.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.0"
fi
i get the folowing:
./demo.sh: line 5: [: ==: unary operator expected
./demo.sh: line 15: [: ==: unary operator expected
./demo.sh: line 25: [: ==: unary operator expected
i was having the same isue in the exam took me a while to trial and error what was wrong i think it has something to do with spaces? but since it is in a course a copy paste should work?